set_vars: Set analysis variables in an scdf object

View source: R/set_vars.R

set_varsR Documentation

Set analysis variables in an scdf object

Description

This function allows to set or change the dependent variable, measurement-time variable, and phase variable in an scdf object.

Usage

set_vars(data, dvar, mvar, pvar)

set_dvar(data, dvar)

set_mvar(data, mvar)

set_pvar(data, pvar)

Arguments

data

A single-case data frame. See scdf() to learn about this format.

dvar

Character string. Name of the dependent variable.

mvar

Character string. Name of the measurement-time variable.

pvar

Character string. Name of the phase variable.

Value

An scdf object with updated variable settings.

Author(s)

Juergen Wilbert

See Also

Other data manipulation functions: add_l2(), as.data.frame.scdf(), as_scdf(), batch_apply(), fill_missing(), moving_median(), print.sc_outlier(), ranks(), rescale(), scdf(), select_cases(), shift(), smooth_cases(), standardize(), truncate_phase()

Examples

exampleAB_add |>
  set_dvar("depression") |>
  describe()

scan documentation built on April 1, 2026, 9:06 a.m.