Select all integer columns.
Description
Select all integer columns.
Usage
cs__integer()
Value
A Polars selector
See Also
cs for the documentation on operators supported by Polars selectors.
Examples
library("polars")
df <- pl$DataFrame(
foo = c("x", "y"),
bar = c(123L, 456L),
baz = c(2.0, 5.5),
zap = 0:1
)
# Select all integer columns:
df$select(cs$integer())
#> shape: (2, 2)
#> ┌─────┬─────┐
#> │ bar ┆ zap │
#> │ --- ┆ --- │
#> │ i32 ┆ i32 │
#> ╞═════╪═════╡
#> │ 123 ┆ 0 │
#> │ 456 ┆ 1 │
#> └─────┴─────┘
#> shape: (2, 2)
#> ┌─────┬─────┐
#> │ foo ┆ baz │
#> │ --- ┆ --- │
#> │ str ┆ f64 │
#> ╞═════╪═════╡
#> │ x ┆ 2.0 │
#> │ y ┆ 5.5 │
#> └─────┴─────┘