Skip to content

UNIVALI-LEMA/JAGGview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JAGGview

Static and dynamic visualization tools for interpreting model outputs generated by JABBA.

R Stage Tests


Overview

JAGGview is an R package for preparing and plotting key diagnostics and results from JABBA model workflows.

The package includes functions to:

  • prepare structured data from model output (e.g., fits, hindcast, retrospective, trajectories, Kobe, priors/posteriors, run tests);
  • create publication-ready ggplot2 visualizations for each analysis component;

Illustration

flowchart LR
  A[JABBA model list] --> B[Data builders
  fits_data / hindcast_data / ...]
  B --> C[Plot builders
  fits_ggplot / hindcast_ggplot / ...]
  C --> D[Diagnostics & communication-ready figures]
Loading

Installation

Linux prerequisites

Before installing the package in R, install JAGS in your system terminal:

sudo apt update
sudo apt install jags

R package installation

Open the R console and install the required dependencies:

install.packages("remotes")
library(remotes)

install.packages(c("rjags", "R2jags"))
install_github("jabbamodel/JABBA")

Option 1: Install from GitHub

install_github("UNIVALI-LEMA/JAGGview")

Option 2: Install from a local clone

install_local(".")

How to use

1) Load the package

library(JAGGview)

2) Prepare data from JABBA model objects

# list_fit_models should contain fit objects returned by JABBA::fit_jabba()
fits_df <- fits_data(list_fit_models)

3) Create a plot

p <- fits_ggplot(fits_df, palette = "#4285f4", title_y = "Abundance index")
print(p)

4) Example with other modules

hc_df <- hindcast_data(list_fit_models)
hc_plot <- hindcast_ggplot(hc_df)
print(hc_plot)

Exported function groups

  • Fits: fits_data(), fits_ggplot()
  • Hindcast: hindcast_data(), hindcast_ggplot()
  • Kobe: kobe_data(), kobe_ggplot()
  • Priors vs posteriors: priors_posteriors_data(), priors_posteriors_ggplot()
  • Retrospective: retrospective_analysis_data(), retrospective_analysis_ggplot()
  • Run tests Cpue residuals: runs_tests_data(), runs_tests_ggplot(), cpue_residuals_ggplot()
  • Trajectories: trajectories_data(), trajectories_ggplot()

Testing

testthat::test_dir("tests/testthat")

License

Licensed under CC BY-NC-SA 4.0.

About

Repository containing the files of the JAGGview package, for building the package developed in R.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages