as.lfobj: Coerce to class "lfobj"

View source: R/lfobj.R

as.lfobjR Documentation

Coerce to class 'lfobj'

Description

Functions to check if object is of class 'fobj' or coerce it if possible. Currently, only methods for 'zoo' and 'xts' exist.

Usage

as.lfobj(x, ...)
is.lfobj(x)
## S3 method for class 'xts'
as.lfobj(x, ...)
## S3 method for class 'zoo'
as.lfobj(x, ...)

Arguments

x

any R object.

...

additional arguments to be passed to or from methods.

Value

An object of class 'lfobj'.

See Also

createlfobj

Examples


data(ngaruroro)
is.lfobj(ngaruroro)

# coerce zoo object to class \code{'lfobj'}
z1 <- zoo(1:10, order.by = seq(Sys.Date(), length.out = 10, by = "days"))
as.lfobj(z1, hyearstart = 5)

# coerce xts object to class \code{'lfobj'}
xts1 <- xts(1:10, order.by = seq(Sys.Date(), length.out = 10, by = "days"))
as.lfobj(xts1, hyearstart = 5)




lfstat documentation built on Nov. 10, 2022, 5:42 p.m.