Read emission estimates generated by the emission_model
or from
emission factor functions (e.g. ef_brazil_cetesb
) and convert
them into a data.table
format.
emis_to_dt(
emi_list,
emi_vars = "emi",
veh_vars = "veh_type",
pol_vars = "pollutant",
process_vars = "process",
segment_vars = NULL
)
list. A list of emission estimates
character. data.frame names of 'emi_list' object attributed to emissions or emission factors. Default is 'emi'.
character. data.frame names of 'emi_list' object attributed to vehicle characteristics. Default is 'veh_type'.
character. data.frame names of 'emi_list' object attributed to pollutants. Default is 'pollutant'.
character. data.frame names of 'emi_list' object attributed to the emission processes. Default is 'process'.
character. data.frame names of 'emi_list' object attributed to the road segments. Default is NULL.
data.table.
Other emission analysis:
emis_grid()
,
emis_summary()
# \donttest{
if (requireNamespace("gtfstools", quietly=TRUE)) {
# read GTFS
gtfs_file <- system.file("extdata/bra_cur_gtfs.zip", package = "gtfs2emis")
gtfs <- gtfstools::read_gtfs(gtfs_file)
# keep a single trip_id to speed up this example
gtfs_small <- gtfstools::filter_by_trip_id(gtfs, trip_id ="4451136")
# run transport model
tp_model <- transport_model(gtfs_data = gtfs_small,
min_speed = 2,
max_speed = 80,
new_speed = 20,
spatial_resolution = 100,
parallel = FALSE)
# Example using Brazilian emission model and fleet
fleet_data_ef_cetesb <- data.frame(veh_type = "BUS_URBAN_D",
model_year = 2010:2019,
fuel = "D",
fleet_composition = rep(0.1,10)
)
emi_list <- emission_model(
tp_model = tp_model,
ef_model = "ef_brazil_cetesb",
fleet_data = fleet_data_ef_cetesb,
pollutant = c("CO","PM10","CO2","CH4","NOx")
)
# convert emission list to data.table
dt <- emis_to_dt(emi_list)
}
#> Converting shapes to sf objects
#> Processing the data
#> Constant emission factor along the route
# }