saveInventory: Save the inventory in NetCDF format

Description Usage Arguments Examples

View source: R/saveInventory.R

Description

Create a NetCDF file from a inventory output or add new variables to an existing file

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
saveInventory(
  gi,
  filename = NA,
  dates,
  variable,
  unit = NA,
  mw = 1,
  time_unit = "year",
  COMPRESS = NA,
  force_ncdf4 = F,
  verbose = T
)

Arguments

gi

a sf output from griding (or stacker)

filename

name of the file

dates

date(s) for the data

variable

name(s) of the pollutant(s) to write

unit

inventory unit

mw

molecular weight

time_unit

time unit, default is "year"

COMPRESS

compression level from 1 to 9, or NA for no compression

force_ncdf4

force NetCDF4 format

verbose

display additional information

Examples

1
2
3
4
grinded_so2 <- readRDS(paste0(system.file("extdata",package="inventory"),"/grid_so2.Rds"))
dir.create(file.path(tempdir(), "INV"))
saveInventory(grinded_so2,filename = paste0(file.path(tempdir(), "INV"),"test.nc"),
                variable = "so2", dates = '2010-01-01')

Schuch666/inventory documentation built on Jan. 31, 2022, 4:37 a.m.