Math.funData | R Documentation |
These functions allow to apply mathematical operations (such as exp(),
log(), sin(), cos()
or abs()
to functional data objects based on
Math
. The operations are made pointwise for each
observation.
## S4 method for signature 'funData'
Math(x)
## S4 method for signature 'multiFunData'
Math(x)
## S4 method for signature 'irregFunData'
Math(x)
x |
An object of class |
An object of the same functional data class as x
.
funData
, irregFunData
,
multiFunData
, Math
oldpar <- par(no.readonly = TRUE)
par(mfrow = c(1,2))
# simulate a funData object on 0..1 with 10 observations
argvals <- seq(0, 1, 0.01)
f <- simFunData(argvals = argvals, N = 10,
M = 5, eFunType = "Fourier", eValType = "linear")$simData
### FunData
plot(f, main = "Original data")
plot(abs(f), main = "Absolute values")
### Irregular
# create an irrgFunData object by sparsifying f
i <- as.irregFunData(sparsify(f, minObs = 5, maxObs = 10))
plot(i, main = "Sparse data")
plot(cumsum(i), main = "'cumsum' of sparse data")
### Multivariate
m <- multiFunData(f, -1*f)
plot(m, main = "Multivariate Data")
plot(exp(m), main = "Exponential")
par(oldpar)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.