fm.sapplyR Documentation

Apply a Function to a FlashR vector/matrix.

Description

sapply applies FUN to every element of a vector/matrix. Currently, sapply only accepts predefined basic operators returned by fm.get.basic.uop.

Usage

fm.sapply(o, FUN, set.na = TRUE)

## S4 method for signature 'fm'
fm.sapply(o, FUN, set.na = TRUE)

## S4 method for signature 'fmV'
fm.sapply(o, FUN, set.na = TRUE)

Arguments

o

a FlashR vector/matrix.

FUN

the reference or the name of a predefined uniary operator.

set.na

a logical value indicating whether to set the value in the output vector or matrix to NA if the value in the corresponding location of the input vector or matrix is NA.

Value

a FlashR vector/matrix.

Author(s)

Da Zheng <dzheng5@jhu.edu>

Examples

mat <- fm.runif.matrix(100, 10)
res <- fm.sapply(mat, "abs")