DataSHIELD implementation of dplyr::mutate.

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

Arguments

df.name

Character specifying a serverside data frame or tibble.

tidy_expr

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 df.name are retained in the output. Options include:

  • "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 tidy_expr for more details.

.after

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

datasources

datashield connections object.

Value

No return value, called for its side effects. An object (typically a data frame or tibble) with the name specified by newobj is created on the server.

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.
}