Description Usage Arguments Details Value Note Examples
pull_clean_pur
returns a data frame of cleaned Pesticide Use Report data
filtered by counties, years, and active ingredients. Active ingredients
or chemical classes present in applied pesticides can be summed by either
Public Land Survey (PLS) section or township.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
years |
A four-digit numeric year or vector of years, starting with
1990. Indicates the years for which you would like to pull PUR
data sets. |
counties |
A vector of character strings giving either a county name,
two digit PUR county codes, or six-digit FIPS county codes for each county.
Not case sensitive. California names, county codes as they appear in PUR
data sets, and FIPS county codes can be found in the |
chemicals |
A string or vector of strings giving search terms of chemicals to match with active ingredients present in pesticides applied in the given years. The default value is "all", which returns records for all active ingredients applied in a given year. See the CDPR's Summary of PUR Data document here: http://www.cdpr.ca.gov/docs/pur/pur08rep/chmrpt08.pdf for comprehensive classifications of active ingredients. |
sum_application |
TRUE / FALSE indicating if you would like to sum the
amounts of applied active ingredients by day, the geographic unit
given in |
unit |
A character string giving either "section" or "township".
Specifies whether applications of each active ingredient should be summed
by California section (the default) or by township. Only used if
|
sum |
A character string giving either "all" (the
default) or "chemical_class". If |
chemical_class |
A data frame with only three columns: |
aerial_ground |
TRUE / FALSE indicating if you would like to retain aerial/ground application data ("A" = aerial, "G" = ground, and "O" = other.) The default is TRUE. |
verbose |
TRUE / FALSE indicating whether you would like a single message printed indicating which counties and years you are pulling data for. The default value is TRUE. |
quiet |
TRUE / FALSE indicating whether you would like a message and progress bar printed for each year of PUR data that is downloaded. The default value is FALSE. |
... |
Used internally. |
PUR data sets are pulled by county from the CDPR's FTP server. Downloaded PUR data sets are saved in a temporary environment, which is deleted at the end of the current R session.
A data frame:
An integer value giving the PUR chemical code
for the active ingredient applied. Not included if
sum_application = TRUE
and sum = "chemical_class"
.
A character string giving PUR chemical active
ingredient names. Unique values of chemname
are matched with terms
provided in the chemicals
argument. Not included
if sum_application = TRUE
and sum = "chemical_class"
.
If sum_application = TRUE
and
sum = "chemical_class"
, this column will give values of the
chemical_class
column in the input chemical_class
data frame.
If there are active ingredients pulled based on the
chemicals
argument that are not present in the chemical_class
data frame, these chemicals will be summed under the class "other".
A numeric value giving the amount of the active ingredient applied (kilograms).
A string nine characters long indicating the section
of application. PLS sections are uniquely identified by a combination of
base line meridian (S, M, or H), township (01-48), township direction
(N or S), range (01-47), range direction (E or W) and section number
(01-36). This column is not included if
sum_application = TRUE
and unit = "township"
.
A string seven characters long indicating the township of application. PLS townships are uniquely identified by a combination of base line meridian (S, M, or H), township (01-48), township direction (N or S), range (01-47), and range direction (E or W).
A character string giving the county name where application took place.
A string two characters long giving the PUR county code where application took place.
A string six characters long giving the FIPS county code where application took place.
The date of application (yyyy-mm-dd).
A character giving the application method.
"A" = aerial, "G" = ground, and "O" = other. Not included
if aerial_ground = FALSE
.
A character string identifying unique application of an
active ingredient across years. This value is a combination of the raw PUR
use_no
column and the year of application. Not included if
sum_appliction = TRUE
.
If the amount listed in kg_chm_used
has been
corrected for large amounts entered in error, this column lists the raw
value of recorded kilograms of applied chemicals. Otherwise NA
. The
algorithm for identifying and replacing outliers was developed based on
methods used by Gunier et al. (2001). Please see the package vignette for
more detail regarding these methods. Not included if
sum_application = TRUE
.
Integer. The California Registration Number for the applied
pesticide (will be repeated for different active ingredients present in
the product). You can match product registration numbers with product
names, which can be pulled using the pull_product_table
function.
This column is not returned if sum_application = TRUE
.
The chemical_list
data frame for a particular year lists
active ingredients present in applied pesticides across the state of
California. Therefore, PUR data for a particular county may not include
records for active ingredients listed in the chemical_list
data set
for the same year.
To pull raw PUR data, see the pull_raw_pur
function.
For documentation of raw PUR data, see the Pesticide Use Report Data User
Guide & Documentation document published by the California Department of
Pesticide Regulation. This file is saved as "cd_doc.pdf" in
any "pur[year].zip" file between 1990 and 2017 found here:
ftp://transfer.cdpr.ca.gov/pub/outgoing/pur_archives/.
If this function returns an error (because the FTP site is down, for example), check your working directory. You may need to change it back from a temporary directory.
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 | library(magrittr)
df <- pull_clean_pur(years = 2000:2001,
counties = c("06001", "29", "riverside"),
chemicals = "methylene",
aerial_ground = TRUE)
# filter to active ingredients present in particular products
prod_nos <- find_product_name(2003, "insecticide")
dplyr::select(prodno)
tibble_to_vector()
df2 <- pull_clean_pur(2003, "10")
dplyr::filter(prodno
# Sum application by active ingredients
df3 <- pull_clean_pur(years = 2009:2010,
counties = c("01", "29", "riverside"),
unit = "township",
sum_application = TRUE)
# Or by chemical classes
chemical_class_df <- rbind(find_chemical_codes(2000, "methylene"),
find_chemical_codes(2000, "aldehyde"))
dplyr::rename(chemical_class = chemical)
df4 <- pull_clean_pur(years = 1995,
counties = "fresno",
chemicals = chemical_class_df$chemname,
sum_application = TRUE,
sum = "chemical_class",
unit = "township",
chemical_class = chemical_class_df)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.