R: Apply Function

apply {fts} | R Documentation

## Apply Function

### Description

Apply a function to the rows or columns of an fts object

### Usage

    column.apply(x, FUN, ...)
    row.apply(x, FUN, ...)

### Arguments

`x` | An Fts object
`FUN` | function to be applied
`...` | further arguments to function

### Value

an Fts object or vector depending on the fuction type

### Author(s)

Whit Armstrong

### Examples

    x <- fts(index=seq(from=Sys.Date(),by="months",length.out=24),data=1:24)
    y <- fts(index=seq(from=Sys.Date(),by="months",length.out=24),data=1:24)

    z <- cbind(x,y)

    ## returns vector
    z.col.sum <- column.apply(z,sum)

    ## returns fts
    z.row.sum <- row.apply(z,sum)

[Package fts version 0.9.9.2 Index]