Read in a model (the function defaults to the example model)
suppressPackageStartupMessages( { library(tidymodels) library(dplyr) library(calanusthreshold) }) log_var <- c("bathymetry", "chlor_a") model <- calanusthreshold::read_model()
Read in a raster, but transform to a tibble.
X <- calanusthreshold::read_raster(form = 'tibble') xy <- X |> dplyr::select(x, y) x <- X |> dplyr::select(-x, -y) |> dplyr:::mutate(dplyr::across(dplyr::any_of(log_var), ~ log10(abs(.x) + 0.00001) ), month = 1) ix <- complete.cases(x)
model_vars <- calanusthreshold::model_predvars(model) x <- x |> dplyr::select(dplyr::all_of(model_vars))
pred <- predict(model, x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.