sd_rows: Take the standard deviation across multiple columns for each...

Description Usage Arguments Value Details See Also

Description

Take the standard deviation across multiple columns for each row of a data.frame

Usage

1
sd_rows(data, string, kind = "starts")

Arguments

data

a data.frame to use for taking the standard deviation across rows

string

a string that can be used in dplyr's select function.

kind

a string indicating which type of dplyr select helper functions. Appropriate values are "starts", "ends", or "matches".

Value

a data.frame with the newly created variable

Details

This function, and those specified below in 'See Also', work best when used inside a call to dplyr's mutate() for creating new variables. The point of the function is to make it easy to use regular expressions to select variables for aggregation, such as an average score for a number of questionnaire items or the sum of correct responses.

See Also

sum_rows for row summing, sum_missings for summing missing values, and average_rows for row averaging across rows.


ethan-young/esyr documentation built on May 15, 2019, 12:45 p.m.