websearch: Search and retrieve toxicity records from the on-line...

websearch_ecotoxR Documentation

Search and retrieve toxicity records from the on-line database


[Experimental] Functions to search and retrieve records from the on-line database at https://cfpub.epa.gov/ecotox/search.cfm.


  fields = list_ecotox_web_fields(),
  habitat = c("aquire", "terrestrial"),
  verify_ssl = getOption("ECOTOXr_verify_ssl"),




A named list of characters, used to build a search for for the on-line search query of https://cfpub.epa.gov/ecotox/search.cfm. Use list_ecotox_web_fields() to construct a valid list.


Use aquire (default) to retrieve aquatic data, terrestrial for, you've guessed it, terrestrial data.


When set to FALSE the SSL certificate of the host (EPA) is not verified. Can also be set as option: options(ECOTOXr_verify_ssl = TRUE). Default is TRUE.


In case of list_ecotox_web_fields() the dots can be used as search field values used to update the returned list of fields.

In case of websearch_ecotox() the dots can be used to pass custom options to the underlying httr::POST() call. For available field names, use names(list_ecotox_web_fields())


The functions described here to search and retrieve records from the on-line database are experimental. This is because this feature is not formally supported by the EPA, and it may break in future iterations of the on-line database. The functions form an interface between R and the ECOTOX website and is therefore limited by its restrictions as described in the package documentation: ECOTOXr. The functions should therefore be used with caution.


Returns named list of dplyr::tibbles with search results. Results are unpolished and ‘as is’ returned by EPA's web service.

list_ecotox_web_fields() returns a named list with fields that can be used in a web search of EPA's ECOTOX database, using websearch_ecotox().


IMPORTANT: when you plan to perform multiple adjacent searches (for instance in a loop), please insert a call to Sys.sleep(). This to avoid overloading the server and getting your IP address banned from the server.


Pepijn de Vries

See Also

Other search-functions: search_ecotox(), websearch_comptox()


## Not run: 
search_fields <-
    txAdvancedSpecEntries     = "daphnia magna",
    txAdvancedChemicalEntries = "benzene",
search_results <- websearch_ecotox(search_fields)

## End(Not run)

ECOTOXr documentation built on Oct. 10, 2023, 1:05 a.m.