Skip to content

Indicate if this expression only selects columns (optionally with aliasing)

Description

This can include bare columns, column matches by regex or dtype, selectors and exclude ops, and (optionally) column/expression aliasing.

Usage

<Expr>$meta$is_column_selection(..., allow_aliasing = FALSE)

Arguments

These dots are for future extensions and must be empty.
allow_aliasing If FALSE (default), any aliasing is not considered pure column selection. Set TRUE to allow for column selection that also includes aliasing.

Value

A logical value.

Examples

library("polars")

e <- pl$col("foo")
e$meta$is_column_selection()
#> [1] TRUE
e <- pl$col("foo")$alias("bar")
e$meta$is_column_selection()
#> [1] FALSE
e$meta$is_column_selection(allow_aliasing = TRUE)
#> [1] TRUE
e <- pl$col("foo") * pl$col("bar")
e$meta$is_column_selection()
#> [1] FALSE
e <- cs$starts_with("foo")
e$meta$is_column_selection()
#> [1] TRUE