Last data update: 2014.03.03

R: Sum of all elements in a list
sumlistR Documentation

Sum of all elements in a list

Description

This is just a wrapper of funlist using sum

Usage

  sumlist(alist, na.rm = FALSE)

Arguments

alist

a list

na.rm

logical indicating whether missing values should be removed

Value

the sum

Author(s)

Gaston Sanchez

See Also

funlist

Examples

# say you have some list
list1 = list(1:5, runif(3), rnorm(4))

# get the sum of all elements in list1
sumlist(list1)

# say you have missing data
list2 = list(c(1:4, NA), runif(3), rnorm(4))

# get the sum of all elements in list2 removing NAs
sumlist(list2, na.rm=TRUE)

Results