Skip to contents

The primary query function for the ECOTOX database. Filters test results by chemical (CAS number), species (common or latin name), endpoint, ecological group, and species characteristic flags. Returns an enriched tibble with metadata joins (exposure types, effects, lifestages, application frequencies) and unit/duration conversions applied.

Usage

eco_results(
  casrn = NULL,
  common_name = NULL,
  latin_name = NULL,
  endpoint = NULL,
  eco_group = NULL,
  invasive = FALSE,
  standard = FALSE,
  threatened = FALSE,
  test_cols = NULL,
  results_cols = NULL,
  con = NULL
)

Arguments

casrn

Character vector of CAS registry numbers to filter by. Dashes are stripped automatically.

common_name

Character vector of common species names.

latin_name

Character vector of latin species names.

endpoint

Character vector of endpoint codes, or the special values "all" (no filter) or "default" (curated set of standard endpoints).

eco_group

Character vector of ecological groups (e.g., "Fish", "Invertebrates").

invasive

Logical; filter to invasive species only?

standard

Logical; filter to standard test species only?

threatened

Logical; filter to endangered/threatened species only?

test_cols

Optional character vector of additional columns to select from the tests table.

results_cols

Optional character vector of additional columns to select from the results table.

con

An optional DBI::DBIConnection.

Value

A tibble of enriched test results with concentration and duration conversions applied. organism_lifestage contains the original ECOTOX code and org_lifestage contains its source description. No derived life-stage categories or reproductive flags are added.

Examples

if (FALSE) { # \dontrun{
# Query by CAS number (DDT)
eco_results(casrn = "50-29-3")

# Query by species with default endpoints
eco_results(common_name = "Rainbow trout", endpoint = "default")

# Query by eco group with custom endpoints
eco_results(eco_group = "Fish", endpoint = c("LC50", "EC50"))
} # }