Description Usage Arguments Details Value Examples
View source: R/ecat_and_scaling_functions.R
calculate_scaling_factors()
constructs temporal scaling factors based on measurements
of elemental carbon (EC) recorded by the EPA in the Cincinnati area. These scaling factors are
the average EC measured over the provided number of days_prior
up to the provided
dates
, divided by the average EC recorded over the ECAT ambient air sampling period (2001 to 2005).
Scaling factors can be multiplied by ECAT estimates from calculate_ecat()
to adjust for
temporal variability in ECAT in the Cincinnati area over time.
1 | calculate_scaling_factors(dates)
|
dates |
A data.frame with 2 columns called 'start_date' and 'end_date' at minimum.
Both columns must be of class |
EPA data in this package is available from November 9, 2001 through May 30, 2019. Scaling factors that attempt to average over EC measured on dates outside this range will not be calculated. In addition, it is important to be mindful of the frequency of EC measurements recorded by the EPA. Note that EC was measured every 6 days through the end of 2010, and every 3 days starting in 2011. If there are less than 4 measurements of EC between the start_date and end_date, the scaling factor will not be calculated and NA will be returned.
A numeric vector of temporal scaling factors.
1 2 3 4 5 6 7 8 9 10 11 12 13 | my_dates <- data.frame(start_date = c("2010-01-08", "2012-06-08", "2010-01-09",
"2015-04-09", "2010-01-10"),
end_date = c("2010-02-08", "2012-07-08", "2010-02-09",
"2015-05-09", "2010-02-10"))
if (FALSE) {
class(my_dates$start_date) # character vector
scaling1m <- calculate_scaling_factors(my_dates)
}
my_dates$start_date <- as.Date(my_dates$start_date)
my_dates$end_date <- as.Date(my_dates$end_date)
scaling1m <- calculate_scaling_factors(my_dates)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.