Write a RasterLayer to a NetCDF file

write_layer_to_cdf(lyr, filename, varname, attrs = list(),
  prec = "double")

Arguments

lyr

RasterLayer to write

filename

output filename

varname

variable name to use in NetCDF file

attrs

list of attributes to attach to the file, e.g., list( list(key='distribution', val='GEV'), # global attribute list(var='precipitation', key='units', val='mm) )

prec

data type for values. Valid types: * short * integer * float * double * char * byte