Extracts data for specified identifiers (CASRN or chemical names) from the EPA's Provisional Peer-Reviewed Toxicity Values (PPRTVs) database. The function retrieves and processes data, with options to use cached files or force a fresh download.
Arguments
- ids
Character vector of identifiers to search (e.g., CASRN or chemical names).
- search_type
Character string specifying the type of identifier: "casrn" or "name". Default is "casrn". If
search_type
is "name", the function performs a partial match search for the chemical name. NOTE: Since partial mached is use, multiple seraches might match the same chemical, therefore chemical ids might not be uniques.- verbose
Logical indicating whether to display progress messages. Default is TRUE.
- force
Logical indicating whether to force a fresh download of the database. Default is TRUE.
- get_all
Logical. If TRUE ignore all the other ignore
ids
,search_type
, setforce = TRUE
and get the all dataset. This is was introduced for debugging purposes.
Value
A data frame with extracted information matching the specified identifiers, or NULL if no matches are found.
Examples
# \donttest{
with_extr_sandbox({ # this is to write on tempdir as for CRAN policies
# Extract data for a specific CASRN
extr_pprtv(ids = "107-02-8", search_type = "casrn", verbose = TRUE)
# Extract data for a chemical name
extr_pprtv(
ids = "Acrolein", search_type = "name", verbose = TRUE,
force = FALSE
)
# Extract data for multiple identifiers
extr_pprtv(
ids = c("107-02-8", "79-10-7", "42576-02-3"),
search_type = "casrn",
verbose = TRUE,
force = FALSE
)
})
#> ℹ Checking Internet Connection...
#> ℹ Internet connection OK...
#> ℹ Checking Internet Connection...
#> ℹ Internet connection OK...
#> ℹ Downloading data from <https://cfpub.epa.gov/ncea/pprtv/atoz.cfm>.
#> ℹ Saving data in the cache /var/folders/bp/fpwcfq1563l21rz5gdcsfcsw0000gn/T//RtmpBHtujD/R/extractox/epa_pprtvs.rds.
#> ℹ Extracting EPA PPRTVs.
#> ✔ Successfully load. epa_pprtvs.rds from cache.
#> ℹ Cache date 2025-02-07 16:38:51.
#> ℹ Set `force = TRUE` to force download from EPA.
#> ℹ Extracting EPA PPRTVs.
#> ✔ Successfully load. epa_pprtvs.rds from cache.
#> ℹ Cache date 2025-02-07 16:38:51.
#> ℹ Set `force = TRUE` to force download from EPA.
#> ℹ Extracting EPA PPRTVs.
#> pprtv_substance_id chemical casrn last_revision
#> 1 1555 Acrolein 107-02-8 2002
#> 2 1594 Bifenox 42576-02-3 2006
#> 3 1556 Acrylic Acid 79-10-7 2010
#> pprtv_assessment
#> 1 https://cfpub.epa.gov/ncea/pprtv/documents/Acrolein.pdf
#> 2 https://cfpub.epa.gov/ncea/pprtv/documents/Bifenox.pdf
#> 3 https://cfpub.epa.gov/ncea/pprtv/documents/AcrylicAcid.pdf
#> iris_link
#> 1 https://cfpub.epa.gov/ncea/iris2/chemicalLanding.cfm?substance_nmbr=364
#> 2 Not available
#> 3 https://cfpub.epa.gov/ncea/iris2/chemicalLanding.cfm?substance_nmbr=2
#> rf_c_value rf_d_value
#> 1 See IRIS See IRIS
#> 2 Not available 9 x 10-3 mg/kg-day
#> 3 See IRIS See IRIS
#> woe date_downloaded
#> 1 Not available 2025-02-07 16:38:51
#> 2 Inadequate information to assess carcinogenic potential 2025-02-07 16:38:51
#> 3 Inadequate information to assess carcinogenic potential 2025-02-07 16:38:51
#> query
#> 1 107-02-8
#> 2 42576-02-3
#> 3 79-10-7
# }