Description Usage Arguments Value Details See Also
Average values across multiple columns for each row of a data.frame
1 | average_rows(data, string, kind = "starts", reverse = NULL)
|
data |
a |
string |
a string that can be used in |
kind |
a string indicating which type of |
reverse |
a numeric vector indicating items or variables to reverse code using
|
a vector of the averaged values for each row from the specified columns of the data frame.
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.
sum_rows
for row summing, sum_missings
for summing
missing values, and sd_rows
for calculating standard deviations across rows.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.