Apply logical AND on a column
Description
Check if all values in a Boolean column are TRUE
. This
method is an expression - not to be confused with pl$all()
which is a function to select all columns.
Usage
<Expr>$all(drop_nulls = TRUE)
Arguments
drop_nulls
|
Logical. Default TRUE, as name says. |
Value
Boolean literal
Examples
library(polars)
pl$DataFrame(
all = c(TRUE, TRUE),
any = c(TRUE, FALSE),
none = c(FALSE, FALSE)
)$select(
# the first $all() selects all columns, the second one applies the AND
# logical on the values
pl$all()$all()
)
#> shape: (1, 3)
#> ┌──────┬───────┬───────┐
#> │ all ┆ any ┆ none │
#> │ --- ┆ --- ┆ --- │
#> │ bool ┆ bool ┆ bool │
#> ╞══════╪═══════╪═══════╡
#> │ true ┆ false ┆ false │
#> └──────┴───────┴───────┘