createNc: Creation of NetCDF from an array

View source: R/createNc.R

createNcR Documentation

Creation of NetCDF from an array

Description

Creates a NetCDF file from an array with values.

Usage

createNc(
  arr,
  varunit,
  varname,
  longname,
  lons,
  lats,
  inidate = NULL,
  scale = NULL,
  out
)

Arguments

arr

array containing the values to export in netcdf.

varunit

character. units in which variable is measured.

varname

character. name of the variable

longname

character. long name of the variable

lons

numeric. vector of longitudes.

lats

numeric. vector of latitudes.

inidate

date. initial day of observations.

scale

character. temporal units for the variable (usually "days", "months" or "years")

out

character. path to the output file.

Value

A NetCDF file is created in the path specified in the "out" parameter.

Examples



try(
createNc(arr = hi,
          varunit = 'ÂșC',
          varname = 'hi',
          longname = 'Huglin Index',
          lons = lon,
          lats = lat,
          inidate = '1980-01-01',
          scale = 'years',
          out = 'hi.nc')
 )
 


agroclim documentation built on Oct. 14, 2022, 9:05 a.m.

Related to createNc in agroclim...