GetVarNCDF: Extracts data from netcdf file and returns a data.frame.

Description Usage Arguments Value Examples

View source: R/GetVarNCDF.R

Description

Extracts data from netcdf file and returns a data.frame.

Usage

1
GetVarNCDF(ncfile, varname, finddim, convert_date = TRUE)

Arguments

ncfile

filename of the netcdf file.

varname

name of the variable to extract.

finddim

vector of dimension variables, e.g, c('time','lat','lev'). For dimensionless variables, e.g, global mean values, and empty vector or NULL should be used.

convert_date

Convert time information into Date/Datetime object. Defaults to TRUE. This parameter is only used, when a date/time variable is found.

Value

A data frame containing at least a single column (value) for the variable value(s) and possible additional columns for each dimension variable.

Examples

1
2
3
     
     ncfile <- system.file("extdata", "example_tll.nc", package = "smumisc")
     d <- GetVarNCDF(ncfile, 'slp', c('lon','lat','time'))

smu/smumisc documentation built on March 21, 2021, 3:38 a.m.