Learn R Programming

ECOTOXr

ECOTOXr can be used to explore and analyse data from the US EPA ECOTOX database. More specifically you can:

  • Build a local SQLite copy of the US EPA ECOTOX database
  • Search and extract data from the local database
  • Sanitise raw data from the local database
  • Use experimental features to search the online dashboards: ECOTOX and CompTox

Why use ECOTOXr?

The ECOTOXr package allows you to search and extract data from the ECOTOXicological Knowledgebase and import it directly into R. This will allow you to formalize and document the search- and extract-procedures in R code. This makes it easier to share and reproduce such procedures and its results. As illustrated in the graphical abstract below. Moreover, you can directly apply any statistical analysis offered in R.

Installation

Get CRAN version

install.packages("ECOTOXr")

Get development version from r-universe

install.packages("ECOTOXr", repos = c("https://pepijn-devries.r-universe.dev", "https://cloud.r-project.org"))

Usage

Preparing the database

Although ECOTOXr has experimental features to search the online database. The package will reach its full potential when you build a copy of the database on your local machine.

Download and build a local copy of the latest ASCII export of the US EPA ECOTOX database

download_ecotox_data()

Searching the local database for species and substances

Once built, you can search the local database for species and substances using different strategies. You can use the build-in search function of this package, or you can write custom queries using either the simple query language (SQL) or dplyr verbs. More details in the following vignettes: vignette("searching-ecotox") and vignette("ecotox-schema").

Disclaimers

It is the end-users own responsibility to check the quality of collected data, using the original referenced source in order to evaluate its fitness for use, see also: https://cfpub.epa.gov/ecotox/help.cfm#info-limitations.

Note that the package maintainer is not affiliated with the US EPA, this package is therefore not official US EPA software.

Resources

Copy Link

Version

Install

install.packages('ECOTOXr')

Monthly Downloads

456

Version

1.2.1

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Pepijn de Vries

Last Published

April 8th, 2025

Functions in ECOTOXr (1.2.1)

mixed_to_single_unit

Convert mixed units to a specific unit
process_ecotox_numerics

Process ECOTOX search results by converting character to numeric where relevant
get_ecotox_url

Get ECOTOX download URL from EPA website
process_ecotox_dates

Process ECOTOX search results by converting character to dates where relevant
websearch_ecotox

Search and retrieve toxicity records from the online database
search_ecotox

Search and retrieve toxicity records from the database
download_ecotox_data

Download and extract ECOTOX database files and compose database
process_ecotox_units

Process ECOTOX search results by converting character to units where relevant
websearch_comptox

list_ecotox_fields

List the field names that are available from the ECOTOX database
as_numeric_ecotox

Values represented by ECOTOX character to numeric
check_ecotox_availability

Check whether a ECOTOX database exists locally
ECOTOXr-package

Package description
build_ecotox_sqlite

Build an SQLite database from zip archived tables downloaded from EPA website
as_unit_ecotox

Text from the ECOTOX database to mixed_units
check_ecotox_version

Check if the locally build database is up to date
check_ecotox_build

Check the locally build database for validity
cas

Functions for handling chemical abstract service (CAS) registry numbers
as_date_ecotox

Values represented by ECOTOX character to dates
cite_ecotox

Cite the downloaded copy of the ECOTOX database
dbConnectEcotox

Open or close a connection to the local ECOTOX database
get_ecotox_sqlite_file

The local path to the ECOTOX database (directory or sqlite file)
get_ecotox_info

Get information on the local ECOTOX database when available