Learn R Programming

far (version 0.6-3)

fapply: Apply functions over a fdata object

Description

fapply returns a fdata object of the same length as data. Each element of which is the result of applying FUN to the corresponding element of data.

Usage

fapply(data, FUN, row.names, ...)

Arguments

data
A fdata object
FUN
the function to be applied. In the case of functions like +, %*%, etc., the function name must be quoted.
row.names
a vector giving the names describing the results of FUN
...
optional arguments to FUN.

Value

  • The returned value is a fdata object too.

Details

This function has to be used only with fdata objects, unless it stop, returning no value.

See Also

apply, lapply.

Examples

Run this code
# Simulation of a FARX process
  data1 <- simul.farx(m=10,n=400,base=base.simul.far(20,5),
                base.exo=base.simul.far(20,5),
                d.a=matrix(c(0.5,0),nrow=1,ncol=2),
                alpha.conj=matrix(c(0.2,0),nrow=1,ncol=2),
                d.rho=diag(c(0.45,0.90,0.34,0.45)),
                alpha=diag(c(0.5,0.23,0.018)),
                d.rho.exo=diag(c(0.45,0.90,0.34,0.45)),
                cst1=0.0)

  fapply(data1,sum)
  multplot(fapply(fapply(data1,abs),cumsum))

Run the code above in your browser using DataLab