Skip to content

Evaluate whether all boolean values in a sub-list are true

Source code

Description

Evaluate whether all boolean values in a sub-list are true

Usage

<Expr>$list$all(..., ignore_nulls = TRUE)

Arguments

These dots are for future extensions and must be empty.
ignore_nulls If TRUE (default), ignore null values. If FALSE, Kleene logic is used to deal with nulls: if the column contains any null values and no FALSE values, the output is null.

Value

A polars expression

Examples

library("polars")

df <- pl$DataFrame(
  a = list(c(TRUE, TRUE), c(FALSE, TRUE), c(FALSE, FALSE), NA, c())
)
df$with_columns(all = pl$col("a")$list$all())
#> shape: (5, 2)
#> ┌────────────────┬───────┐
#> │ a              ┆ all   │
#> │ ---            ┆ ---   │
#> │ list[bool]     ┆ bool  │
#> ╞════════════════╪═══════╡
#> │ [true, true]   ┆ true  │
#> │ [false, true]  ┆ false │
#> │ [false, false] ┆ false │
#> │ [null]         ┆ true  │
#> │ null           ┆ null  │
#> └────────────────┴───────┘