arraytonc: arraytonc: Create an nc file from an array

Description Usage Arguments Value See Also

Description

arraytonc creates a new netCDF file from an array object.

Usage

1
arraytonc(a, fileout, varname, units, r, tme, baseyear = 1900)

Arguments

a

the array containing the data to be used to create the new netCDF file.

fileout

the name and location of the nteCDF file to be created.

varname

the name of the variable to be created (character string).

units

The variable's units (character string). Or, pass a zero length string (") to have no units attribute.

r

a raster file with extent parameters that the new netCDF file should follow.

tme

an object of class POSIXlt representing calendar dates and times.

baseyear

the calendar year that measurements began.

Value

an object of class ncdf4 that has the fields described above and is saved to the location specified by 'fileout'.

See Also

the tmecreate() function can be used to create a POSIXlt object.

mydata <- array(rnorm(1460), dim = c(2,2,1460)) r <- raster(mydata,,1) tme <- tmecreate(2010, 6) arraytonc (mydata, "new.nc", varname = "6-hourly air temperature", units = "degrees Celcius", r, tme, baseyear = 1900)


ilyamaclean/climvars documentation built on June 19, 2019, 2:22 p.m.