ufs (version 0.3.2)

makeScales: Title

Description

Title

Usage

makeScales(data, scales, append = TRUE)

Arguments

data

The dataframe containing the variables (the items).

scales

A list of character vectors with the items in each scale, where each vectors' name is the name of the scale.

append

Whether to return the dataframe including the new variables (TRUE), or a dataframe with only those new variables (FALSE).

Value

Either a dataframe with the newly created variables, or the supplied dataframe with the newly created variables appended.

Examples

Run this code
# NOT RUN {
### First generate a list with the scales
scales <- list(scale1 = c('mpg', 'cyl'), scale2 = c('disp', 'hp'));

### Create the scales and add them to the dataframe
makeScales(mtcars, scales);
# }

Run the code above in your browser using DataCamp Workspace