Description Usage Arguments Value Examples
lapply returns a list of the same length as X, each element of which is the result of applying FUN to the corresponding element of X.
1 2 3 4 | spc.lapply(X, FUN, ...)
## S4 method for signature 'SpcList'
spc.lapply(X, FUN, ...)
|
X |
A |
FUN |
function to be applied to each element of X. |
... |
optional arguments to FUN. |
list or SpcList object.
1 2 3 4 5 6 7 |
sp=spc.example_spectra()
BL=spc.makeSpcList(sp,"CAST")
#Counts rows (returns a list object)
spc.lapply(BL,function(x) {nrow(x)})
#Perform arithmetic operations on all Spectra elements. Returns a SpcList object.
spc.lapply(BL,function(x) {x^2+1})
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.