sum_score: sum_score() computes the mean for a given set of variables in...

View source: R/sum_score.R

sum_scoreR Documentation

sum_score() computes the mean for a given set of variables in a row wise manner

Description

sum_score() computes the mean for a given set of variables in a row wise manner

Usage

sum_score(..., na.rm = TRUE)

Arguments

x, y, z

are set of variables from a data frame (i.e. a selection of numeric columns)

Details

simple wrapper to produce row wise sums (default is na.rm=TRUE)

Value

a numeric vector

Examples

library(dplyr)
data_frame %>%
mutate(score =  sum_score(x, z, y))



dacarras/r4sda documentation built on Nov. 9, 2023, 10:17 a.m.