as.data.frame.ncslice4: Convert a NetCDF slice into a data.frame

Description Usage Arguments See Also Examples

View source: R/nc_slice.R

Description

Convert a slice read from a NetCDF file with ncvar_slice into a data.frame for further manipulation of the data.

Usage

1
2
## S3 method for class 'ncslice4'
as.data.frame(x, row.names = NULL, optional = FALSE, ...)

Arguments

x

a NetCDF slice object, extracted via ncvar_slice.

row.names

NULL or a character vector giving the row names for the data frame. Missing values are not allowed.

optional

logical. If TRUE, setting row names and converting column names (to syntactic names: see make.names) is optional.

...

ignored.

See Also

ncvar_slice to read the slice and as.xyz.ncslice4 to convert it into another format.

Examples

1
2
3
4
nc <- nc_open(system.file("extdata", "sresa1b_ncar_ccsm3.nc", package="ncdf4helpers"))
x <- ncvar_slice(nc, "tas")
nc_close(nc)
head(as.data.frame(x))

jiho/ncdf4helpers documentation built on May 19, 2019, 10:31 a.m.