Learn R Programming

lfstat (version 0.9.12)

as.lfobj: 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 xts
as.lfobj(x, ...)
# S3 method for zoo
as.lfobj(x, ...)

Value

An object of class 'lfobj'.

Arguments

x

any R object.

...

additional arguments to be passed to or from methods.

See Also

createlfobj

Examples

Run this code

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)



Run the code above in your browser using DataLab