as.data.frame method {mondate}R Documentation

Coerce a mondate to a Data Frame

Description

Function to coerce a mondate for containment in a data.frame.

Usage

## S3 method for class 'mondate'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)

Arguments

x

a mondate.

row.names

NULL or a character vector giving the row names for the data frame. Missing values are not allowed.

optional

logical. See base::as.data.frame for details.

...

optional additional arguments to be passed to or from methods.

Details

Although users would normally call data.frame, the as.data.frame function is the underlying workhorse that enables a mondate to be stored in a data.frame. When array-shaped mondates are stored, the number of rows is retained and if the dimension > 2 it is "flattened" in the usual data.frame sense. The mondate method is fashioned after the as.data.frame.Date method.

See Also

data.frame, as.data.frame, format

Examples

YE <- mondate.mdy(12, 31, 2001:2005)
data.frame(yearend = YE, value = 1000 * 1.05^(1:5)) # 5% annual inflation

[Package mondate version 1.0 Index]