This function converts an object of class fd (from package fda) to an object of class funData. It heavily builds on the function eval.fd from the fda package. The fd representation assumes a basis representation for the observed functions and therefore implicitly smoothes the data. In funData objects, the data is saved in 'raw' format.
fd2funData(fdobj, argvals,...)
Arguments
fdobj: An fd object
argvals: A vector or a list of length one, containing a vector with argument values at which the functions in fdobj should be evaluated.
...: Other parameters passed to eval.fd.
Returns
An object of class funData.
Warning
Time names in fdobj$fdnames$time are not preserved.
Examples
# Install / load package fda before running the exampleslibrary("fda")# from Data2fd helpdaybasis <- create.fourier.basis(c(0,365), nbasis=65)# fd object of daily temperaturestempfd <- Data2fd(argvals = day.5, y = CanadianWeather$dailyAv[,,"Temperature.C"], daybasis)# convert to funDatatempFun <- fd2funData(tempfd, argvals = day.5)# plot to comparepar(mfrow = c(1,2))plot(tempfd, main ="fd object")plot(tempFun, main ="funData object")