Description Usage Arguments Value Note Examples
For a particular location, buffer radius, date range, and active ingredient
or class of active ingredients, calculate_exposure
calculates an
estimate of exposure in kg of active ingredient per m^2.
1 2 3 4 5 6 7 8 9 10 11 12 |
clean_pur_df |
A data frame returned by |
location |
A length-one character string. Either a California address including street name, city, state, and 5-digit zip code, or a pair of coordinates in the form "longitude, latitude". |
radius |
A numeric value greater than zero that gives the radius in meters defining the buffer around your location in which you would like to calculate exposure. For reference, the length and width of a PLS section is about 1,609 meters (1 mile). That of a township could range from about 9,656 to 11,265 meters (6-7 miles). |
time_period |
Optional. A character string giving a time period over which you
would like to calculate exposure in days, weeks, months, or years.
For example, if you enter "6 months" for |
start_date |
Optional. "yyyy-mm-dd" specifying the start date for
exposure estimation. This date should be present in the |
end_date |
Optional. "yyyy-mm-dd" specifying the end date for exposure
estimation. This date should be present in the |
chemicals |
Either "all" or "chemical_class". The default is "all", which
will calculate exposure to the summed active ingredients present in the
|
aerial_ground |
TRUE / FALSE for whether you would like to
incorporate aerial/ground application into exposure calculations. If
|
verbose |
TRUE / FALSE for whether you would like a message to print out
while the function is running. The default is |
... |
Used internally. |
A list with five elements:
A data frame with 9 columns: exposure
,
the estimate of exposure in kg/m^2, chemicals
, (either "all",
indicating that all active ingredients present in the clean_pur_df
were summed or the chemical class(es) specified in the clean_pur_df
data frame), start_date
, end_date
, aerial_ground
,
which can take values of "A" = aerial, "G" = ground, and "O" = others, (if
the aerial_ground
argument is FALSE
, aerial_ground
will be NA
in the exposure
data frame), location
,
radius
, the radius in meters for the buffer extending from the
location, and the longitude
and latitude
of the location.
A data frame with 12 columns and at least one row for
every section or township intersected by the specified buffer extending
from the given location. Columns include pls
, giving either the
Public Land Survey (PLS) section (9 characters long) or township (7
characters long), chemicals
, percent
, the percent that the
PLS unit is overlapped by the buffer, kg
, the total amount of kg
applied for the specified chemicals and date range in that section or
township, kg_intersection
, the amount of kilograms applied
multiplied by the percent of overlap, start_date
and end_date
,
aerial_ground
, which can take values of "A" (aerial), "G" (ground),
or "O" (other), and will be NA
if exposure calculations did not
take aerial/ground application into account, none_recorded
, logical
for whether any pesticide application was recorded for the specified section
or township, date range, and chemicals, location
, and radius
.
A data frame with 24 columns. Contains spatial plotting
data for the buffer and overlapping sections or townships. You can use the
df_plot
function to quickly plot and get a rough idea of the
area for which exposure was calculated, before moving on to other
plot_* functions.
A ggplot2 plot showing the location of your specified
buffer in the context of the county. Depending on if your clean_pur_df
data frame was summed by section or township, the county will be shown
with the relevant PLS units.
The data frame supplied to the clean_pur_df
argument, filtered to the county and date range for which exposure
was calculated.
If the time_period
, start_date
, and end_date
arguments are all left as NULL (their defaults), then exposure will
be estimated across the entire date range of the clean_pur_df
data frame.
If you pulled PUR data from pull_clean_pur
specifying
sum_application = TRUE
and unit = "township"
, then
exposure will be calculated based on townships. Using the
df_plot
function to plot the returned buffer_plot
list element could be helpful to see the difference between
calculating exposure based on sections or townships for a certain
buffer radius.
This function takes advantage of the Google Maps Geocoding API, and is limited by the standard usage limit of 2,500 free requests per day and 50 requests per second. https://developers.google.com/maps/documentation/geocoding/usage-limits
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | library(magrittr)
clean_pur <- readRDS(system.file("extdata", "fresno_clean.rds",
package = "purexposure"))
fresno_spdf <- readRDS(system.file("extdata", "fresno_spdf.rds",
package = "purexposure"))
exposure_list <- calculate_exposure(clean_pur, location = "-120.098794, 36.532866",
radius = 3000, spdf = fresno_spdf)
# specify time intervals
exp_list2 <- calculate_exposure(clean_pur,
location = "13883 Lassen Ave, Helm, CA 93627",
radius = 3000,
time_period = "4 months")
exp_list2$exposure
# calculate exposure by township
clean_pur2 <- pull_clean_pur(1995, counties = "san bernardino",
sum_application = TRUE, unit = "township")
exp_list3 <- calculate_exposure(clean_pur2,
location = "-116.45, 34.96",
radius = 5000)
df_plot(exp_list3$buffer_plot)
exp_list3$county_plot
# calculate exposure by specified chemical classes
# this is an example of `none_recorded = TRUE`
chemical_class_df <- rbind(find_chemical_codes(2000, "methylene"),
find_chemical_codes(2000, "aldehyde"))
dplyr::rename(chemical_class = chemical)
exp_list4 <- pull_clean_pur(1995, "fresno",
chemicals = chemical_class_df$chemname,
sum_application = TRUE,
sum = "chemical_class",
chemical_class = chemical_class_df)
calculate_exposure(location = "13883 Lassen Ave, Helm, CA 93627",
radius = 1500,
chemicals = "chemical_class")
exp_list4$meta_data
# incorporate aerial/ground application information
exp_list5 <- pull_clean_pur(2000, "yolo")
calculate_exposure(location = "-121.9018, 38.7646",
radius = 2500,
aerial_ground = TRUE)
exp_list5$exposure
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.