Caribou

indicator_count_disturbance <- length(
  params$reportList$disturbance %>%
    distinct(critical_hab) %>%
    pull(critical_hab)
)
facet_ncol_disturbance <- 3
facet_chart_height_disturbance <- 1.25 * indicator_count_disturbance / facet_ncol_disturbance

Proportion Disturbed

chart_line_faceted(
  data = params$reportList$disturbance,
  x_var = timeperiod,
  y_var = (dist_per * 100),
  color_var = scenario,
  facet_chart = TRUE,
  facet_vars = critical_hab,
  facet_ncol = facet_ncol_disturbance,
  facet_nrow = ceiling(
    indicator_count_disturbance / facet_ncol_disturbance
  ),
  facet_scales = 'fixed',
  xlab = "Future year",
  ylab = "Percent Disturbed",
  is_plotly = FALSE
)

Proportion Disturbed with 500m Buffer

chart_line_faceted(
  data = params$reportList$disturbance,
  x_var = timeperiod,
  y_var = (dist500_per * 100),
  color_var = scenario,
  facet_chart = TRUE,
  facet_vars = critical_hab,
  facet_ncol = facet_ncol_disturbance,
  facet_nrow = ceiling(
    indicator_count_disturbance / facet_ncol_disturbance
  ),
  facet_scales = 'fixed',
  xlab = "Future year",
  ylab = "Percent Disturbed",
  is_plotly = FALSE
)

Forest Age

````r chart_line_faceted( data = params$reportList$survival, x_var = timeperiod, y_var = prop_age, color_var = scenario, facet_chart = TRUE, facet_vars = herd_bounds, xlab = "Future year", ylab = "Proportion Age 0 to 40 years" )

````r
chart_line_faceted(
  data = params$reportList$survival,
  x_var = timeperiod,
  y_var = prop_mature,
  color_var = scenario,
  facet_chart = TRUE,
  facet_vars = herd_bounds,
  xlab = "Future year",
  ylab = "Proportion Age 80 to 120 years"
)

````r chart_line_faceted( data = params$reportList$survival, x_var = timeperiod, y_var = prop_old, color_var = scenario, facet_chart = TRUE, facet_vars = herd_bounds, xlab = "Future year", ylab = "Proportion > 120 years" )

### Population

````r
if (!is.null(params$reportList$abundance)) {
  chart_line_faceted(
    data = params$reportList$abundance,
    x_var = timeperiod,
    y_var = abundance_avg,
    color_var = scenario,
    facet_chart = TRUE,
    facet_vars = subpop_name,
    xlab = "Future year",
    ylab = "Abundance"
  )
} else {
  cat('\n')
  cat('No data found for selection.')
  cat('\n')
  cat('\n')
}

````r data <- params$reportList$survival data[, survival_rate_change := survival_rate - first(survival_rate), by = .(scenario, herd_bounds)]

chart_line_faceted( data = data, x_var = timeperiod, y_var = survival_rate_change, color_var = scenario, facet_chart = TRUE, facet_vars = herd_bounds, xlab = "Future year", ylab = "Change in Annual Adult Female Survival Rate" )

### Resource Selection

````r
data <- as.data.table(params$reportList$rsf)

if (nrow(data)) {
  data[, rsf_perc_change := ((first(sum_rsf_hat) - sum_rsf_hat) / first(sum_rsf_hat) * 100), by = .(scenario, rsf_model)]
  chart_line_faceted(
    data = data,
    x_var = timeperiod,
    y_var = rsf_perc_change,
    color_var = scenario,
    facet_chart = TRUE,
    facet_vars = rsf_model,
    add_y_intercept = TRUE,
    xlab = "Future year",
    ylab = "RSF Value Percent Change"
  )
} else {
  cat('\n')
  cat('No data found for selection.')
  cat('\n')
}


bcgov/clus_explorer documentation built on Oct. 16, 2022, 1:56 p.m.