ncvar_get_df_values: From netCDF variable to Data Frame

Description Usage Arguments See Also Examples

Description

It puts valus of a data frame in a netCDF archive

Usage

1
2
3
ncvar_get_df_values(x = c("Prec", "Temp"), start = NA, count = NA,
  dimTime = "Time", dimStation = list(c("Station", "StationIdName")),
  show_month = FALSE, show_year = FALSE, show_season = FALSE, nc, ...)

Arguments

x

names of the variables to get

nc

An object of class ncdf4 (as returned by either function nc_open or function nc_create), indicating what netCDF file to read from.

start

index vactor where to start the reading data.

count

vector containing the data layers to be read.

dimTime

name of Time dimension. If it is declared (Default is Time), time is returned as POSIXct. To run this option, time is required to be expressed in seconds in the netCDF file.

show_month,show_year,show_season

logical values. If TRUE month or year and season are shown respectively.

dimStation

TO DO

...

further arguments for ncvar_get.

See Also

ncvar_put,ncvar_get_multidf_values

Examples

1
2
3
4
5
6
7
library(ncdf4df)
## ncname <- "/Users/ecor/Dropbox/iasma/RMAWGENdev/ncdf4df/inst/trentino/data/trentino_hourlyweatherdata.nc"
ncname <- system.file("trentino/data/trentino_hourlyweatherdata.nc",package="ncdf4df")
nc <- nc_open(ncname)
meteoPrec <- ncvar_get_df_values(nc=nc,x="Prec",verbose=TRUE)
meteoPrec2 <- ncvar_get_df_values(nc=nc,x="Prec",verbose=TRUE,show_year=TRUE,show_month=TRUE)
nc_close(nc)

ecor/ncdf4df documentation built on May 15, 2019, 10:06 p.m.