Skip to content

Select columns from this LazyFrame

Description

This will run all expression sequentially instead of in parallel. Use this when the work per expression is cheap.

Usage

<LazyFrame>$select_seq(...)

Arguments

\<dynamic-dots\> Name-value pairs of objects to be converted to polars expressions by the as_polars_expr() function. Characters are parsed as column names, other non-expression inputs are parsed as literals. Each name will be used as the expression name.

Value

A polars LazyFrame

Examples

library("polars")

lf <- pl$LazyFrame(
  foo = 1:3,
  bar = 6:8,
  ham = letters[1:3]
)
lf$select_seq("foo", bar2 = pl$col("bar") * 2)$collect()
#> shape: (3, 2)
#> ┌─────┬──────┐
#> │ foo ┆ bar2 │
#> │ --- ┆ ---  │
#> │ i32 ┆ f64  │
#> ╞═════╪══════╡
#> │ 1   ┆ 12.0 │
#> │ 2   ┆ 14.0 │
#> │ 3   ┆ 16.0 │
#> └─────┴──────┘