extractmonths: Extracts the rows of a matrix corresponding to requested...

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/extractmonths.R

Description

Extracts the rows of a matrix corresponding to requested months of a year given the date (origin) of the first row

Usage

1
2
3
extractmonths(data = array(1:ndim_max, dim = c(ndim_max, 1)),
  ndim_max = 1e+05, when = c("Dec", "Jan", "Feb"), year = NULL,
  origin = "1961-1-1")

Arguments

data

an input data matrix where each row corresponds to a daily record

ndim_max

maximum (integer) number of rows in data where to find when. Default is 100000 and works if data is missing.

when

character vactor of months for which the data are required. It must be a subset of c("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")

year

year(s) when data must be extracted

origin

date corresponding to the first row of data

Value

a matrix containing the requested rows

Note

It uses months and julian

Author(s)

Emanuele Cordano, Emanuele Eccel

See Also

extractdays

Examples

1
2
3
4
5
6
extractmonths()

data(trentino)
dates <- sprintf("%02d-%02d-%02d",TEMPERATURE_MAX$year,TEMPERATURE_MAX$month,TEMPERATURE_MAX$day)
origin <- dates[1]
out <- extractmonths(data=TEMPERATURE_MAX,origin=origin)

RMAWGEN documentation built on Dec. 12, 2019, 9:07 a.m.