Period-class: Time periods - eg. a month or a season or a year.

Period-classR Documentation

Time periods - eg. a month or a season or a year.

Description

A simple S4 class to define a month, a season or a year used for aggregating monthly values to seasonal or annual values and for making monthly plots with nice labels etc.

Usage

all.periods

periods

all.months

all.seasons

annual

Format

An object of class list of length 17.

List ofPeriod objects

An object of class list of length 12.

An object of class list of length 4.

An object of class list of length 1.

Details

Since these are for the most part standard (ie. people commonly need the months, the seasons (DJF, MAM, JJA, SON) and annual) these are defined in simple list that might be commonly used and can be looped through. These are:

months

which contains all the months.

seasons

which contains all the seasons.

annual

which only contains only the annual period.

all.periods, periods

which contains all of the above.

However other periods can be defined for specific growing seasons etc.

Slots

id

A unique character string to identify this particular time period. Recommended to be alphanumeric because it is used to construct file names.

name

A character string to describe the spatial extent. Used for building plot labels, not file names, so doesn't need to be alphanumeric and can so can be prettier.

abbreviation

Not really sure if this is necessary, think is it covered by the "id" slot

index

The index of the months of the year for this period. For example, Jan has index = 1, DJF has index =c (12,1,2) and annual has index = c(1,2,3,4,5,6,7,8,9,10,11,12)

padded.index

As slot index but zero-padded strings for use in when encoding/decoding file names.

contains

Holds the names of the other periods included in this period. For example for Jan just contains "Jan", but DJF it contains c("Dec","Jan,"Feb)

days

Number of days in this time period during a normal (non-leap) year

days.leap

Number of days on this period during a leap year

col

A colour (as a character string) for this particular period

Author(s)

Matthew Forrest matthew.forrest@senckenberg.de


MagicForrest/DGVMTools documentation built on Aug. 23, 2024, 8:05 a.m.