Skip to contents

Note: I ran this on unity after using devtools::load_all() it seemed to be writing temporary files to the inst/rmd directory. This suggests that it might not work with an installed version of BirdFlowPipeline. If that's the case we'd have to copy the Rmd from the package to a temorary location before knitting.

Usage

make_new_report(
  model,
  bmtr,
  anim,
  html,
  routes,
  prevlink = NA,
  nextlink = NA,
  test_metrics = NA,
  train_metrics = NA,
  title = NA,
  cor_threshold = NA,
  cor_metric = NA,
  mean_rating = NA
)

Arguments

model

path to HDF5 model file

bmtr

path to BMTR RDS file containing output from BirdFlowR::calc_bmtr()

anim

path to abundance and flux animation GIF

html

path to output html file

routes

path to routes plot

relative path to the previous species report or NULL if there is none.

relative path to the next species report or NULL if none.

test_metrics, train_metrics

Optional data frame containing performance metrics from the grid search for the training and test datasets respectively. If NA than the tuning section isn't included in the report. @param title Title for report, default of NA results in " BMTR" @param cor_threshold,cor_metric Threshold and metric used to exclude models that are not sufficient close to the training S&T distributions

mean_rating

Mean rating from 1 (worst) to 5 (best), assigned to the BirdFlow model by a minimum of two reviewers on the BirdFlow team.

Value

Nothing is returned, a report is created at html

Examples

if (FALSE) { # \dontrun{

p <- list()
p$model <-  system.file("rmd/example_data/sstspa_model.hdf5", package = "BirdFlowPipeline") 
p$bmtr <-  system.file("rmd/example_data/sstspa_bmtr.Rds", package = "BirdFlowPipeline") 
p$anim <-  system.file("rmd/example_data/sstspa_anim.gif", package = "BirdFlowPipeline") 
p$html <-  tempfile(fileext = ".html", pattern = "report")
p$routes <-  system.file("rmd/example_data/sstspa_routes.hdf5", package = "BirdFlowPipeline") 
p$prevlink <-  NA
p$nextlink <-  NA
p$test_metrics <-  system.file("rmd/example_data/sstspa_test_metrics.rds", package = "BirdFlowPipeline") |> readRDS()                             
p$train_metrics <-  system.file("rmd/example_data/sstspa_train_metrics.rds", package = "BirdFlowPipeline")   |> readRDS()
p$title <- "Example Species Report"
p$cor_threshold <- 0.9
p$cor_metric <- "min_dist_cor"  
p$mean_rating <- 4

do.call(make_new_report, args = p)

} # }