Description Usage Arguments Value Author(s) Examples
Applies a function to the nonzero elements of a sparse vector or matrix
1 | applyFunctionSparsely(z, f)
|
z |
a sparse vector or matrix |
f |
a function |
Returns the variable z, with only the value of the nonzero elements changed
Michael Love
1 2 3 | sds <- simulateSparseDataSet(100, c(5,5))
logPlusOne <- function(x) log(x + 1)
sparseData(sds) <- applyFunctionSparsely(sparseData(sds), logPlusOne)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.