Learn R Programming

ncdf.tools (version 0.7.1.295)

convertDateR2Ncdf: Convert time vectors in netCDF files to Julian days since a certain origin

Description

This function automatically converts time vectors in netCDF files to a standardized Gregorian calendar

Usage

convertDateR2Ncdf(ncdf.obj, date.vec = "auto", origin = "1800-01-01", write.to.ncdf = TRUE)

Arguments

ncdf.obj
character string or netCDF connection: netCDF file for which to convert the dates
date.vec
POSIXct vector: date vectors for the time dimension. If set to 'auto', this is tried to be extracted from the netCDF file
origin
character string: origin to be used for the time vector. This start of the Gregorian calendar should be kept to avoid possible mistakes due to flawed conversions.
write.to.ncdf
logical: whether to write the time vector to the netCDF file.

Value

Details

This function sets a time vector in a netCDF file to a standardized format which is readable by most software. It transfers the time vector to days since the start of the Gregorian calendar.