Skip to contents

Collage of hex logos for hera and related packages

WORK IN PROGRESS

Hera is a prototype package to explore the future of regulatory environmental modelling. The package outlines approaches to creating a shared research platform for building, testing and deploying models used to assess environmental risk for regulatory purposes. See Request for comment paper for an outline and broad technical specifications.

Hera is envisaged as an opinionated collections of R packages designed for sharing environmental models. All packages share an underlying design, grammar and data structure. This allows the separation of concerns between data, models, post-modelling and visualisation. Allowing greater collaboration and sharing of methods and tools.

Heraclitus:

You Cannot Step Into the Same River Twice

Installation

Install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("ecodata1/hera")

Documentation

Read the white paper article and documentation website (work in progress)

Example

Assess some demo data for various environmental risks:

library(hera)
data <- assess(hera::demo_data)
data[1:5, c("sample_id", "parameter", "question", "response")]
#> # A tibble: 5 × 4
#>   sample_id parameter            question     response
#>   <chr>     <chr>                <chr>        <chr>   
#> 1 1672942   River Family Inverts sample_score 0       
#> 2 1672942   River Family Inverts ntaxa        1       
#> 3 1672942   River Family Inverts wfd_awic     0       
#> 4 1800006   River Family Inverts sample_score 0       
#> 5 1800006   River Family Inverts ntaxa        1

Alternatively, you can view the catalogue and select which assessments to be run.

catalogue
#> # A tibble: 5 × 3
#>   assessment                data               assessment_function
#>   <chr>                     <list>             <list>             
#> 1 MPFF Compliance           <tibble [34 × 10]> <fn>               
#> 2 Macroinvertebrate Metrics <tibble [22 × 10]> <fn>               
#> 3 DARLEQ3                   <tibble [36 × 12]> <fn>               
#> 4 Bankside Consistency      <tibble [29 × 12]> <fn>               
#> 5 RICT                      <tibble [30 × 12]> <fn>

Then select which assessment(s) you wish to run by name:

assessments <- assess(demo_data,
  name = c(
    "RICT",
    "Macroinvertebrate Metrics"
  )
)
assessments[1:5, c("sample_id", "parameter", "question", "response")]
#> # A tibble: 5 × 4
#>   sample_id parameter            question     response
#>   <chr>     <chr>                <chr>        <chr>   
#> 1 1672942   River Family Inverts sample_score 0       
#> 2 1672942   River Family Inverts ntaxa        1       
#> 3 1672942   River Family Inverts wfd_awic     0       
#> 4 1800006   River Family Inverts sample_score 0       
#> 5 1800006   River Family Inverts ntaxa        1

Heraclitus:

Everything flows