nc_time: Read NetCDF Times and Convert to POSIXct

Description Usage Arguments See Also Examples

Description

Based on the time dimension of the NetCDF connecction supplied, the date-time string is converted to internal POSIXct format.

Usage

1
nc_time(nc)

Arguments

nc

netcdf file connection

See Also

nc_open for opening netcdf files, as.Date and as.POSIXct for information on R Date format

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
nc <- list(dim=list(time=NULL))
nc$dim$time <- list(units='seconds since 1979-01-01 00:00:00',
                    vals=c(0,31535999, 31536000))
nc_time(nc)

nc$dim$time <- list(units='days since 1979-01-01',
                    vals=c(0.5, 364.99, 365))
as.Date(nc_time(nc))

nc$dim$time <- list(units='months since 1979-01-30',
                    vals=0:24)
nc_time(nc)

jonasbhend/myhelpers documentation built on May 19, 2019, 7:27 p.m.