vein (version 0.7.8)

emis_chem: Aggregate emissions by lumped groups in chemical mechanism

Description

emis_chem aggregates emissions by chemical mechanism and convert grams to mol. This function reads all hydrocarbos and respective criteria polluants specified in ef_ldv_speed and ef_hdv_speed.

Usage

emis_chem(dfe, mechanism, colby, long = FALSE)

Arguments

dfe

data.frame with column `emissions` in grams and `pollutant` in long format.

mechanism

Character, "RADM2_SORG", "CBMZ_MOSAIC", "CPTEC", "GOCART_CPTEC", "MOZEM", "MOZCEM", "CAMMAM", "MOZMEM", "MOZC_T1_EM", "CB05_OPT1" or "CB05_OPT2"

colby

Character indicating column name for aggregating extra column. For instance, region or province

long

Logical. Do you want data in long format?

Value

data.frame with lumped groups by chemical mechanism. It transform emissions in grams to mol.

See Also

ef_ldv_speed ef_hdv_speed speciate ef_evap

Examples

Run this code
# NOT RUN {
{
# CO
df <- data.frame(emission = Emissions(1:10))
df$pollutant = "CO"
emis_chem(df, "CBMZ_MOSAIC")
# hexanal
df$pollutant = "hexanal"
emis_chem(df, "CBMZ_MOSAIC")
# propadiene and NO2
df2 <- df1 <- df
df1$pollutant = "propadiene"
df2$pollutant = "NO2"
(dfe <- rbind(df1, df2))
emis_chem(dfe, "CBMZ_MOSAIC")
dfe$region <- rep(letters[1:2], 10)
emis_chem(dfe, "CBMZ_MOSAIC", "region")
emis_chem(dfe, "CBMZ_MOSAIC", "region", TRUE)
}
# }

Run the code above in your browser using DataLab