extr_pprtv: Extract Data from EPA PPRTVs

View source: R/extr_pprtv.R

extr_pprtvR Documentation

Extract Data from EPA PPRTVs

Description

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.

Usage

extr_pprtv(
  ids,
  search_type = "casrn",
  verbose = TRUE,
  force = TRUE,
  get_all = FALSE
)

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, set force = 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.

See Also

EPA PPRTVs

Examples


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
  )
})


extractox documentation built on April 4, 2025, 2:30 a.m.