vein (version 1.0.2)

emis_chem: (in development, needs checks) 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)

Value

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

Arguments

dfe

data.frame with column `emissions` in grams and `pollutant` in long format. It is supposed that each line is the pollution of some region. Then the `coldby` argument is for include the name of the region.

mechanism

Character, "SAPRC", "RACM", "RADM2", "CBMZ", "MOZART", "SAPRC99", "CB05", "CB06CMAQ", "CB05CMAQ", "RACM2CMAQ", "SAPRC99CMAQ", "SAPRC07CMAQ", "SAPRC07A", "RADM2_SORG", "CBMZ_MOSAIC", "CPTEC", "GOCART_CPTEC", "MOZEM", "MOZCEM", "CAMMAM", "MOZMEM", "MOZC_T1_EM", "CB05_OPT1", "CB05_OPT2", "CRIMECH"

colby

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

long

Logical. Do you want data in long format?

See Also

ef_ldv_speed ef_hdv_speed speciate ef_evap

Examples

Run this code
if (FALSE) {
# CO
df <- data.frame(emission = Emissions(1:10))
df$pollutant = "CO"
emis_chem(dfe = 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