Learn R Programming

Rfssa (version 3.1.0)

as.funts: Convert Object to a funts

Description

This function allows you to convert various types of objects into a functional time series (funts) object.

Usage

as.funts(obj, basis = NULL)

Value

An object of class funts.

Arguments

obj

the object to be converted. It can be an object of class fd (functional data) of the package `fda`, fts (functional time series) of the package `rainbow` types.

basis

an optional argument specifying the basis to be used for the resulting funts object when converting from fts objects. If not provided, a B-spline basis will be created by default.

See Also

funts, create.bspline.basis

Examples

Run this code
require(rainbow)
class(Australiasmoothfertility)
x_funts1 <- as.funts(Australiasmoothfertility)
plot(x_funts1, main = "Australians Fertility")

require(fda)
bs <- create.bspline.basis(rangeval = c(15, 49), nbasis = 13)
fd_obj <- smooth.basis(argvals = Australiasmoothfertility$x, Australiasmoothfertility$y, bs)$fd

x_funts <- as.funts(fd_obj)
plotly_funts(x_funts,
  main = "Australians Fertility",
  ylab = "Fertility rate",
  xlab = "Age"
)

Run the code above in your browser using DataLab