Learn R Programming

M3 (version 0.3)

get.datetime.seq: Read in a sequence of date-time steps from a Models3-formatted file.

Description

Read the date-time steps in the Models3-formatted file. Put these into R's datetime format.

Usage

get.datetime.seq(file)

Arguments

file
File name of Models3-formatted file which contains the date-time information of interest.

Value

file, in POSIXct format.

Warning

This code assumes that the time step is not negative. For instance, the Models3 I/OAPI does allow for negative time steps, but these negative time steps will NOT be handled properly by this function. For more information about Models3 date-time conventions, see http://www.baronams.com/products/ioapi/DATETIME.html.

Details

This function relies on the R package ncdf4 to read information from Models3-formatted files, since the Models3 format is built on netCDF (http://www.unidata.ucar.edu/software/netcdf).

References

Information about the Models3 date-time conventions is available at http://www.baronams.com/products/ioapi/DATETIME.html.

See Also

DateTimeClasses, seq.POSIXt, get.M3.var

Examples

Run this code
## As mentioned in notes above, user will not typically call
## this function directly.

## Find the path to a demo file with lambert conic conformal projection.
lcc.file <- system.file("extdata/ozone_lcc.ncf", package="M3")

## Get vector containing date-times available in this file.
datetime.seq <- get.datetime.seq(lcc.file)

Run the code above in your browser using DataLab