Learn R Programming

table.express (version 0.1.1)

transmute-table.express: Alias for select

Description

Because of the way data.table and the select-table.express method work, a dplyr::transmute() equivalent can be specified as a select clause.

Usage

# S3 method for ExprBuilder
transmute(.data, ...,
  .parse = getOption("table.express.parse", FALSE),
  .chain = getOption("table.express.chain", TRUE))

Arguments

.data

An instance of ExprBuilder.

...

Clause for selecting/computing on columns. The j inside the data.table's frame.

.parse

Logical. Whether to apply rlang::parse_expr() to obtain the expressions.

.chain

Logical. Should a new frame be automatically chained to the expression if the clause being set already exists?

Details

If length(...) == 1L and the expression is a call to : (e.g. a:c), a numeric, or a call to tidyselect::select_helpers, then it will be taken as the single expression for the select clause, otherwise everything in ... will be wrapped in a call to base::list().

To see more examples, check the vignette, or the table.express-package entry.

Examples

Run this code
# NOT RUN {
data("mtcars")

data.table::as.data.table(mtcars) %>%
    start_expr %>%
    transmute(ans = mpg * 2)

# }

Run the code above in your browser using DataLab