matrix_apply: matrix_apply

Description Usage Arguments Value Note Examples

View source: R/TeaSetClass.R

Description

applies the matrix function with nrow to a list before using apply with a function

Usage

1
matrix_apply(x, nrow, fun, ...)

Arguments

x

a 1d list of data

nrow

how many rows to put the list into

fun

the function to apply() to the matrix after creating it

...

Any additional arguments for the function provided

Value

a list from using the apply function on the new matrix

Note

length of new list must be evenly divisible by nrow. This function was built to simplify some code in TeaSet

Examples

1
2
test_data <- 1:16
         matrix_apply(test_data, nrow = 4, fun = sum)

cmpear/TeaSet_Package documentation built on Jan. 10, 2020, 2:46 a.m.