Description Usage Arguments Value Examples
create a sf object with the emission and the geographic area which this emission will be distributed.
1 |
geom |
sf object describing the geometry of each area |
values |
numeric vector (for one variable) or list of vectors (for multiple variables) of total mass |
variable |
name(s) of the pollutant(s) |
names |
area names |
mass_unit |
mass unit, default is "t" (ton) |
verbose |
display additional information |
a sf with the area shapes and the total emission for each area
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | continents <- sf::st_read(paste0(system.file("extdata",package="inventory"),"/continent.shp"),
quiet = TRUE)
continents <- continents[1:5,]
so2 <- read.csv(paste0(system.file("extdata",package="inventory"),"/SO2.csv"))
names(so2) <- c("region","year","mass")
so2 <- so2[so2$year == 2010,]
# for a single pollutant
so2_2010 <- geoemiss(geom = continents,
values = so2$mass,
names = so2$region,
variable = "so2")
# for multiples pollutants, NO values is twice so2 emissions for exercice purpose
so2_NO_2010 <- geoemiss(geom = continents,
values = list(so2$mass,2 * so2$mass),
names = so2$region,
variable = c("so2","NO"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.