Generate a netCDF populated with data from a generator

generate_raster(fname, varnames = c("data"), generator = stats::runif,
  nrow = 18, ncol = 36, extent = c(-180, 180, -90, 90),
  attrs = list(), append = FALSE)

Arguments

fname

of the generated netCDF

varnames

character vector of variable names to write to fname

generator

a function that will be called with no arguments to produce values to populate the variables

nrow

number of rows in the generated netCDF

ncol

number of columns in the generated netCDF

extent

vector of (xmin, xmax, ymin, ymax)

attrs

List of attributes to associate with the file, or with each variable. Each attribute is described by a list, with the following properties:

var

Variable with which the attribute is associated, or NULL for a global attribute

key

Name of the attribute

val

Value of the attribute

append

Determines if we should add variables to an existing file, if present.