Learn R Programming

mason (version 0.3.0)

add_variables: Add variables to the analysis

Description

While different analyses use different types of variables, in general they can be classified as in the 'y' or 'x' position of a statistical equation. They can further be classified as covariates and as an interaction term.

Usage

add_variables(
  data,
  type = c("yvars", "xvars", "covariates", "interaction"),
  variables
)

Arguments

data

The blueprint data object.

type

The variable type, i.e. where it is located on the equation (y position, x, as a covariate, etc.)

variables

Variables to use for the type specified

Value

Adds variables to the blueprint

Examples

Run this code
# NOT RUN {
library(magrittr)
ds <- design(iris, 'cor') %>%
 add_settings()
add_variables(ds, 'xvar', 'Sepal.Length')
add_variables(ds, 'yvar', 'Petal.Length')

ds <- design(iris, 't.test')
ds <- add_variables(ds, 'yvar', c('Sepal.Length', 'Sepal.Width'))
ds <- add_variables(ds, 'xvar', 'Petal.Length')

# }

Run the code above in your browser using DataLab