find_chemical_codes: Pull active ingredient chemical codes from PUR Chemical...

Description Usage Arguments Value Note Examples

View source: R/02-find.R

Description

For a vector of chemical names, find_chemical_codes returns a data frame with corresponding chemical codes from the PUR Chemical Lookup Table for a given year. This function uses pattern matching to return results. As a starting place, or for more thorough classifications, see the CA Department of Pesticide Regulation's Summary of Pesticide Use Report Data, Indexed by Chemical (2016): https://www.cdpr.ca.gov/docs/pur/pur16rep/chmrpt16.pdf

Usage

1
find_chemical_codes(years, chemicals = "all", by_year = FALSE)

Arguments

years

A vector of four-digit numeric years, starting with 1990. Indicates the years in which you would like to match chemical codes.

chemicals

A string or vector of strings giving search terms of chemicals to match with active ingredients present in pesticides applied in the given year. The default value is "all", which returns codes for all active ingredients applied in a given year.

by_year

TRUE / FALSE for whether you would like PUR Chemical Lookup Tables separated by year (in a 'year' column). If 'by_year' is 'FALSE', the default, a data frame is returned with unique results from all years given in the 'years' argument.

Value

A data frame:

chem_code

An integer value with chemical codes corresponding to each active ingredient. chem_code values are used to later filter raw PUR data sets.

chemname

A character string giving unique active ingredients corresponding to each search term.

chemical

A character string with search terms given in the chemicals argument. Not included if the 'chemicals' argument is set to its default value of "all".

year

Included if 'by_year' is set to 'TRUE'.

Note

The PUR Chemical Lookup Table for a year lists all 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 returned by find_chemical_codes for the same year.

Examples

1
2
find_chemical_codes(2000, "methyl bromide")
find_chemical_codes(1995, c("ammonia", "benzene"))

leighseverson/purexposure documentation built on Aug. 13, 2021, 6:34 p.m.