find_rowwise_sum_multiplecol {packDAMipd}R Documentation

Function to get sum of multiple columns of observations

Description

Function to get sum of multiple columns of observations

Usage

find_rowwise_sum_multiplecol(the_data, colnames, sumcolname)

Arguments

the_data

the data where the observations are held

colnames

columnname in the data whose sum to be obtianed

sumcolname

name of the new column where sum to be saved

Value

the data with added sum

Examples

eg_data <- as.data.frame(list(no = c(1, 2, 3, 4),
mark_at_1 = c(12, 7, 23, 45), gender = c("M", "F", "M", "F"),
mark_at_2 = c(12, 34, 89, 45), trialarm = c("1","1","2","2"),
time = c(1,1,2,2), id = c(1, 1, 1, 2)))
find_rowwise_sum_multiplecol(eg_data, c("mark_at_1","mark_at_2"),
"totalmarks")

[Package packDAMipd version 1.1.0 Index]