nc2time: reads and converts the time variable of a netcdf-file...

Description Usage Arguments Author(s) Examples

View source: R/nc2time.r

Description

reads and converts the time variable of a netcdf-file ('.nc'-file) or ncdf4-object as as.Date-object.

Usage

1
nc2time(nc,varname)

Arguments

nc

character string indicating the filepath to a netcdf-file ('.nc'-file), or a ncdf4-object.

varname

character string indicating the name of the time vaiable of the netcdf-file.

Author(s)

Robert K. Bauer

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
owd <- getwd()
setwd(system.file("test_files", package="oceanmap"))
nfile <- Sys.glob('herring*.nc') # load sample-'.nc'-files
head(nc2time(nfile))

library('ncdf4')
nc <- nc_open(nfile)
head(nc2time(nc))

setwd(owd)

oceanmap documentation built on July 4, 2017, 9:08 a.m.

Search within the oceanmap package
Search all R packages, documentation and source code