turner (version 0.1.7)

prodlist: Product of all elements in a list

Description

This is just a wrapper of funlist using prod

Usage

prodlist(alist, na.rm = FALSE)

Value

the product

Arguments

alist

a list

na.rm

logical indicating whether missing values should be removed

Author

Gaston Sanchez

See Also

funlist

Examples

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

# get the product of all elements in list1
prodlist(list1)

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

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

Run the code above in your browser using DataCamp Workspace