create_time_info: Helper function to create the definition of the time...

View source: R/time_dimensions.R

create_time_infoR Documentation

Helper function to create the definition of the time dimension for use in a netCDF file

Description

Helper function to create the definition of the time dimension for use in a netCDF file. Defaults to create an hourly axis.

Usage

create_time_info(from, n, time_step = "hours since",
  time_step_delta = 1L, tzoffset)

Arguments

from

the start date of the time axis

n

length of the time dimension

time_step

unit prefix in the time dimension units

time_step_delta

integer, length of time units between each steps

tzoffset

an optional character, the time offset from UTC, e.g. '+1000' for 10 hours ahead of UTC. Can be missing, in which case 'from' must be explicitly a UTC time. Note that the tzoffset completely supersedes the time zone if present.

Value

A list with keys units and values

See Also

See create_efts for examples

Examples

timeAxisStart <- ISOdate(2015, 10, 4, 0, 0, 0, tz = "Australia/Canberra")
(time_dim_info <- create_time_info(from = timeAxisStart, n = 24L, 
  time_step = "hours since", time_step_delta = 3L, tzoffset = "+1000"))

# Note that the time zone information of thes sart date is NOT 
# used by create_time_info; the tzoffset argument takes precedence 
timeAxisStart <- ISOdate(2015, 10, 4, 0, 0, 0, tz = "Australia/Perth")
(time_dim_info <- create_time_info(from = timeAxisStart, n = 24L, 
  time_step = "hours since", time_step_delta = 3L, tzoffset = "+1000"))


jmp75/efts documentation built on Sept. 3, 2024, 7:13 a.m.