normanR provides helper functions to query the Norman Network Database System (NDS) REST API and process the retrieved chemical and ecotoxicological data.
The package enables researchers in environmental chemistry and ecotoxicology to retrieve chemical substance data, ecotoxicological parameters, and EMPODAT monitoring datasets, handle batch queries across multiple identifiers, flatten complex nested API responses into clean tabular structures, and organize local JSON data files.
- **Direct querying of all main NDS modules (
susdat,ecotox,empodat,passive) with strict input parameter validation with automated pagination and optional disk caching. - Nested Field Extraction (
extract_norman_fields): Recursively search and extract nested JSON list outputs into tidydata.frameformats. - Offline File Organization (
split_json_files_by_key,split_json_files_by_pattern): Partition bulk offline JSON files into structured subdirectories based on specific field keys or regular expressions. - API Metadata Lookup (
load_api_definitions): Load API dictionary definitions from local JSON storage.
You can install the development version of normanR directly from GitHub using devtools or remotes:
# Install pack if not already installed
if (!requireNamespace("pak", quietly = TRUE)) {
install.packages("pak")
}
# Install normanR from GitHub
pak::pak("urniaz/normanR/normanR")or from CRAN
# Install normanR from CRAN
install.packages("normanR")library(normanR)
# Fetch substance data by CAS number using the core function
data_cas <- get_norman_data(
module = "susdat",
parameter = "casrn",
value = "1490-04-6",
format = "json"
)
data_cas$`Compound name`| Metadata element | Description |
|---|---|
| Current Code Version | 1.3.77 |
| Permanent Code Repository | https://github.com/urniaz/normanR |
| Legal Code License | GNU General Public License v3.0 (GPL-3) |
| Code Versioning System | Git |
| Software Language | R (>= 4.1.0) |
| Dependencies | httr2, jsonlite |
| Testing Framework | testthat (>= 3.0.0) |