nc.make.time.bounds {ncdf4.helpers}R Documentation

Creates time bounds for a time series

Description

Creates time bounds for a time series.

Usage

nc.make.time.bounds(ts, unit = c("year", "month"))

Arguments

ts

The time values, of type PCICt

unit

The units to be used.

Details

When aggregating data along the time axis, it is occasionally useful to be able to generate bounds for that data. This function will, given a time series of PCICt, returns a set of bounds for that time series based the supplied units.

Value

2-dimensional bounds array for the time values with dimensions [length(ts), 2].

References

http://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html#climatological-statistics

Examples

library(PCICt)
ts <- as.PCICt(c("1961-01-15", "1961-02-15", "1961-03-15"), cal="360")
ts.bounds <- nc.make.time.bounds(ts, unit="month")


[Package ncdf4.helpers version 0.3-6 Index]