## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>", fig.align = "center")

## -----------------------------------------------------------------------------
library(climniche)

case_path <- system.file("extdata/mediterranean_anchovy", package = "climniche")
summary_tab <- read.csv(file.path(case_path, "anchovy_climniche_summary.csv"))
class_tab <- read.csv(file.path(case_path, "anchovy_climniche_classes.csv"))
variable_tab <- read.csv(file.path(case_path, "anchovy_climniche_top_variables.csv"))
records <- read.csv(file.path(case_path, "anchovy_clean_obis_records.csv"))

## -----------------------------------------------------------------------------
summary_tab[, c(
  "n", "boundary_quantile", "mean_climate_change_amount",
  "mean_niche_distance_change", "prop_niche_divergence",
  "prop_niche_exceedance", "prop_niche_convergence"
)]

head(class_tab)
head(variable_tab)
nrow(records)

## ----echo = FALSE, out.width = "100%"-----------------------------------------
knitr::include_graphics("figures/anchovy-mediterranean-maps.png")

## ----echo = FALSE, out.width = "80%"------------------------------------------
knitr::include_graphics("figures/anchovy-climniche-diagram.png")

## ----echo = FALSE, out.width = "95%"------------------------------------------
knitr::include_graphics("figures/anchovy-climniche-showcase.png")

## -----------------------------------------------------------------------------
class_tab[, c("class", "proportion")]
variable_tab[, c("variable", "mean_contribution", "interpretation")]

