Learn R Programming

zoocat (version 0.2.0.1)

gmon: A class for generalized month index

Description

In the "gmon" class, a integer number is used to indicate the month. The number from 1 to 12 is used to indicate Jan to Dec of the reference year. The number from -11 to 0 is used to indicate Jan to Dec of the previous year, and the number from 13 to 24 corresponds to the next year, and so on.

Usage

gmon(x)

Arguments

x

a vector of integers.

Details

When print a "gmon" object, the suffix ".0" means the current year, ".1" means the next year and ".-1" means the previous year, and so on. For example, Feb of the next year is printed as "Feb.1". The methods scale_x_gmon and scale_y_gmon are provided to show "gmon" objects properly based on ggplot.

Examples

Run this code
# NOT RUN {
mvec <- gmon(-20:25)
print(mvec)
x <- 1 : 46
names(x) <- mvec
print(x)

# }

Run the code above in your browser using DataLab