The openCARES R package contains tools to assist with the analysis of vehicle remote emission sensing data. The tools focus on the development of new insights from potentially complex data sets. This is anticipated to be useful for those working on the development of remote emission sensing technologies, in addition to end users such as city authorities, who want to better understand real-world emissions. The package has been developed under the framework of the City Air Remote Emission Sensing (CARES) project. For the main CARES website, see https://cares-project.eu/.
require(devtools)
install_github('davidcarslaw/openCARES')
The goal of the CARES project is to reduce the hurdles for the practical application of remote emission sensing. The analysis of RES data can be challenging and within the community of researchers and practitioners that typically conduct experiments, there is a wide variation in the analysis approaches used and their consistency.
The main component of the openCARES
package is the production of an
automated summary report, which provides a quick and reliable way of
presenting key summary data and plots from remote sensing measurement
campaigns. End users can compile a report based on their own remote
emission sensing data. The report provides details of measurement site
conditions, vehicle fleet composition, and an evaluation of
fuel-specific emission factors by vehicle type, fuel type, emission
standard, manufacturer and so on. The effect of ambient temperature and
vehicle deterioration on emissions is also explored.
The package aims to provide key summaries of emissions and the vehicle fleet that will typically be of common interest. All the analysis code is available in the package and can be modified and extended. The package contains an example data set from a remote sensing campaign held in Milan in 2021.
A summary of the fields available in the example Milan data is given below:
library(openCARES)
dplyr::glimpse(rs_dat)
## Rows: 35,568
## Columns: 69
## $ campaign_id <chr> "IT_2021_1", "IT_2021_1", "IT_2021_1", "IT_2…
## $ date_time <chr> "2021-09-29T10:32:57.88195Z", "2021-10-02T09…
## $ site_num <int> 2, 2, 1, 1, 2, 1, 2, 2, 2, 2, 1, 2, 2, 2, 1,…
## $ veh_id <chr> "Milan_00001", "Milan_00002", "Milan_00003",…
## $ valid_status <lgl> FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE,…
## $ co_co2 <dbl> NA, NA, NA, 0.000803, 0.001867, 0.001797, -0…
## $ no_co2 <dbl> NA, NA, NA, 0.000072, 0.004267, 0.000246, 0.…
## $ no2_co2 <dbl> NA, NA, NA, 0.000080, 0.000644, 0.000064, 0.…
## $ hc_co2 <dbl> NA, NA, NA, -0.000540, -0.000115, -0.000235,…
## $ pm_co2 <dbl> NA, NA, NA, 0.000002, 0.000236, 0.000003, 0.…
## $ pm_co2_old <dbl> NA, NA, NA, -0.000018, -0.000203, 0.000110, …
## $ ch4_co2 <dbl> NA, NA, NA, -0.000020, -0.000088, 0.000267, …
## $ co_fm_rep <dbl> NA, NA, NA, 1.615289319, 3.743048139, 3.6045…
## $ no_fm_rep <dbl> NA, NA, NA, 0.23628743, 14.05101246, 0.81198…
## $ no2_fm_rep <dbl> NA, NA, NA, 0.26437754, 2.12187665, 0.210905…
## $ nox_fm_rep <dbl> NA, NA, NA, 0.50066, 16.17289, 1.02289, 2.62…
## $ hc_fm_rep <dbl> NA, NA, NA, -3.4136094, -0.7260072, -1.48423…
## $ pm_fm_rep <dbl> NA, NA, NA, 0.000294, 0.030624, 0.000403, 0.…
## $ pm_fm_rep_old <dbl> NA, NA, NA, -0.00235, -0.02625, 0.01428, 0.0…
## $ ch4_fm_rep <dbl> NA, NA, NA, -0.02315, -0.10089, 0.30523, -0.…
## $ speed <dbl> NA, NA, NA, 27.576, 56.232, 16.020, 47.844, …
## $ accel <dbl> NA, NA, NA, 0.1080, -2.5668, -0.5256, 0.0000…
## $ vsp_rep <dbl> NA, NA, NA, 2.09, -7.31, 0.30, 3.93, 4.76, 3…
## $ amb_temp <dbl> NA, NA, NA, 24.8, 16.4, 17.9, 28.9, 27.4, 22…
## $ amb_atm_pressure <dbl> NA, NA, NA, 1005.33, 1001.29, 1008.37, 1002.…
## $ amb_rhum <int> NA, NA, NA, 54, 54, 56, 38, 40, 38, 49, 40, …
## $ amb_wind_speed <dbl> NA, NA, NA, 0.8, 1.5, 0.3, 2.3, 0.7, 1.5, 2.…
## $ amb_wind_dir <dbl> NA, NA, NA, 99.6, 357.9, 63.1, 0.8, 352.4, 5…
## $ exhaust_temp <dbl> NA, NA, NA, 67.3, 50.8, 17.9, 28.9, 63.1, 70…
## $ invalid_reason <chr> "CO2_Outlier", "CO2_Outlier", "Count_Outlier…
## $ co_fm <dbl> NA, NA, NA, 1.615289795, 3.742042283, 3.6045…
## $ hc_fm <dbl> NA, NA, NA, -3.4139197, -0.7244140, -1.48149…
## $ no_fm <dbl> NA, NA, NA, 0.23793986, 14.05033942, 0.81066…
## $ no2_fm <dbl> NA, NA, NA, 0.26437762, 2.12055744, 0.210905…
## $ pm_fm <dbl> NA, NA, NA, 0.000287000, 0.033786899, 0.0004…
## $ ch4_fm <dbl> NA, NA, NA, -0.02298936, -0.10078804, 0.3060…
## $ vsp_calc <dbl> NA, NA, NA, 2.0957510, -7.3051537, 0.3033980…
## $ veh_class <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ veh_category <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ make_raw <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ make_domain <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ model <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ fuel_type_1 <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ fuel_type_2 <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ ptr_type <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ emission_standard_raw <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ emission_standard_code <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ emission_standard <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ veh_variant <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ veh_version <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ eng_disp <int> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ eng_power <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ reg_date_domestic <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ reg_date_abroad <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ curb_weight <int> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ gross_weight <int> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ co2_nedc <int> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ co2_wltp <int> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ mileage <int> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ inspection_date <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ particulate_filter_status <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
## $ site_name <chr> "Cilea", "Cilea", "Madre Cabrini", "Madre Ca…
## $ slope <dbl> 0.172, 0.172, 0.057, 0.057, 0.172, 0.057, 0.…
## $ latitude <dbl> 45.49768, 45.49768, 45.45234, 45.45234, 45.4…
## $ longitude <dbl> 9.09990, 9.09990, 9.19894, 9.19894, 9.09990,…
## $ altitude <int> 136, 136, 116, 116, 136, 116, 136, 136, 136,…
## $ instrument_id <int> 8, 8, 9, 9, 8, 9, 8, 8, 8, 8, 9, 8, 8, 8, 9,…
## $ nox_fm <dbl> NA, NA, NA, 0.50231748, 16.17089685, 1.02157…
## $ nox_dist <dbl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
The summary report was written in Quarto, a system that enables a rich selection of outputs to be produced using R code as well as other programming languages such as Python. The easiest way to compile a report is to download a free version of the RStudio IDE, which recognises the Quarto format. The compiled report is an html document that can be opened in a browser. This choice of output was chosen in preference to pdf or Word because of the range of useful interactive capabilities available in html format. These capabilities make the investigation of remote sensing data engaging and informative, allowing the user to easily interrogate much of the data. The source file to test is available in the repository itself (/inst/Summary-analysis.qmd). This file can easily be edited to change or extend the analysis undertaken using R code.
To produce an automated report using data other than that provided by
the openCARES
package requires that certain field names exist in the
data set. A summary of the required fields is given in the compiled
report
Summary-analysis.html.