Description Usage Arguments Details References Author(s)
Mutate a Spectra* object by transforming the spectra values, and/or adding new or replacing existing attributes.
1 |
.data |
an object inheriting from the |
... |
named parameters giving definitions of new columns |
This function is very similar to transform
but it executes
the transformations iteratively so that later transformations can use the
columns created by earlier transformations. Like transform, unnamed
components are silently dropped.
Mutate seems to be considerably faster than transform for large data.frames.
Either the spectra, and/or the attributes (if the .data
inherits from the SpectraDataFrame
class) can be affected:
To affect the spectra, one should use the nir
placeholder, eg nir = log(1/nir)
To affect the attributes of the object, the definitions of new columns are simply given using attributes names, newAttribute = 1/sqrt(attribute)
Both spectra and attrbutes can be transformed in one command, eg mutate(s, nir = log(1/nir), newAttribute = 1/sqrt(attribute)
Hadley Wickham (2011). The Split-Apply-Combine Strategy for Data Analysis. Journal of Statistical Software, 40(1), 1-29. URL http://www.jstatsoft.org/v40/i01/.
Pierre Roudier pierre.roudier@gmail.com, from code from Hadley Wickham
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.