Learn R Programming

dsTidyverse (version 1.0.4)

mutateDS: Create, modify, and delete columns

Description

DataSHIELD implentation of mutate.

Usage

mutateDS(tidy_expr, df.name, .keep = NULL, .before = NULL, .after = NULL)

Value

An object of the same type as df.name, typically a data frame or tibble.

Arguments

tidy_expr

Name-value pairs. The name gives the name of the column in the output.

df.name

A data frame, data frame extension (e.g. a tibble), or a lazy data frame (e.g. from dbplyr or dtplyr).

.keep

.keep Control which columns from df.name are retained in the output. Grouping columns and columns created by tidy_expr are always kept.

  • "all": Retains all columns from df.name. This is the default.

  • "used": Retains only the columns used in tidy_expr to create new columns.

  • "unused": Retains only the columns not used in tidy_expr to create new columns. This is useful if you generate new columns but no longer need the columns used to generate them.

  • "none": Doesn't retain any extra columns from df.name. Only the grouping variables and columns created by tidy_expr are kept.

Grouping columns and columns created by tidy_expr are always kept.

.before

<tidy-select> Optionally, control where new columns should appear (the default is to add to the right hand side). See relocate for more details.

.after

<tidy-select> Optionally, control where new columns should appear (the default is to add to the right hand side). See relocate for more details.