Learn R Programming

BIOdry (version 0.9)

moveYr: Seasonal years

Description

Monthly records in time-series replicates (usually of climate) are labeled for the years can begin in a month other than January.

Usage

moveYr(cd, ini.mnt = "Oct")

Value

data.frame object with the months being numeric

values and the years beginning at ini.mnt argument.

Arguments

cd

data.frame. Multilevel ecological data series or numeric vector of repeated years with vector names belonging to month.abb.

ini.mnt

character, or numeric from 1 to 12. Initial month of the seasonal year. If character then the months are built-in constants in R-package base. Default 'Oct' makes the years begin in October, for example.

Author

Wilson Lara <wilarhen@gmail.com>, Felipe Bravo <fbravo@pvs.uva.es>

Details

character months as defined in month.abb or month.name.

Examples

Run this code
## Climatic records of monthly precipitation sums and monthly
## average temperatures
data(PTclim05,envir = environment())

## Making the year 1955 in plot 'P16106' to begin on 'April'
cl1 <- slitFrame(PTclim05,c('year','plot'))[[1]]
cl2 <- moveYr(cl1,ini.mnt = 'Mar')
head(cl2)

## a simple vector of years
yr <- rep(2005,12)
names(yr) <- month.abb[1:12]
moveYr(yr)

Run the code above in your browser using DataLab