as.xyz.ncslice4: Convert a NetCDF slice into xyz list

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 x,y,z list suitable for image, contour, persp, etc.

Usage

1
2
## S3 method for class 'ncslice4'
as.xyz(x)

Arguments

x

a NetCDF slice object, extracted via ncvar_slice

See Also

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

Examples

1
2
3
4
5
6
7
nc <- nc_open(system.file("extdata", "sresa1b_ncar_ccsm3.nc", package="ncdf4helpers"))
x <- ncvar_slice(nc, "tas")
nc_close(nc)
# inspect and transform the result
str(x)
x <- as.xyz(x)
str(x)

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