mondate (version 1.0)

as.list method: Construct a list from a mondate

Description

Function to construct a list from a mondate.

Usage

# S3 method for mondate
as.list(x, ...)

Arguments

x

a mondate.

...

optional additional arguments to be passed to or from methods.

Details

Constructs a list from a mondate object. The length of the list equals the length of x. Each sublist contains an individual element of x. This method is most useful when a mondate is the X argument of one of the *apply functions. See an example of a recommended call to sapply in "Examples" below.

Examples

Run this code
YE <- mondate.mdy(12, 31, 2011:2012)
sapply(YE, class)    # "mondate" "mondate"
sapply(YE, month)   # same as month(YE)
month(YE)

Run the code above in your browser using DataLab