DataSHIELD implementation of dplyr::mutate.

ds.mutate(
  df.name = NULL,
  tidy_select = NULL,
  newobj = NULL,
  .keep = "all",
  .before = NULL,
  .after = NULL,
  datasources = NULL
)

Arguments

df.name

Character specifying a serverside data frame or tibble.

tidy_select

List of tidyselect syntax to be passed to dplyr::mutate.

newobj

Character specifying name for new server-side data frame.

.keep

Control which columns from .data are retained in the output. Grouping columns and columns created by ... are always kept. "all" retains all columns from .data. This is the default. "used" retains only the columns used in `tidy_select` to create new columns. "unused" retains only the columns not used in `tidy_select` 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_select` are 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.

datasources

datashield connections object.

Value

An object with the name specified by the newobj argument is written serverside.

Examples

if (FALSE) {
## First log in to a DataSHIELD session with mtcars dataset loaded.

ds.mutate(
  df.name = "mtcars",
  tidy_select = list(mpg_trans = cyl * 1000, new_var = (hp - drat) / qsec),
  newobj = "df_with_new_cols"
)

## Refer to the package vignette for more examples.
}