I am trying to run some integrated SDMs with the BART engine to compare to models I ran with the embarcadero package with just one type of data, but cannot get the model to run with my data or the test data in the package. Perhaps I am missing some input parameters required for running, but either I can't find the relevant documentation or it doesn't exist yet.
Here is the example code that I tried to run with the data included in the package:
# Background layer
background <- terra::rast(system.file("extdata/europegrid_50km.tif", package = "ibis.iSDM", mustWork = TRUE))
# Load virtual species points
virtual_species <- sf::st_read(system.file("extdata/input_data.gpkg",package = "ibis.iSDM", mustWork = TRUE), "points")
# Predictors
predictors <- terra::rast(list.files(system.file("extdata/predictors/", package = "ibis.iSDM", mustWork = TRUE), "*.tif", full.names = TRUE))
# Make use only of a few of them
predictors <- subset(predictors, c("bio01_mean_50km","bio03_mean_50km","bio19_mean_50km",
"CLC3_112_mean_50km","CLC3_132_mean_50km",
"CLC3_211_mean_50km","CLC3_312_mean_50km",
"elevation_mean_50km"))
mod.bart <- distribution(background) |>
add_biodiversity_poipo(virtual_species, field_occurrence = "Observed") |>
add_predictors(env = predictors, transform = "scale", derivates = "none") |>
# A presence only dataset
engine_bart() |>
# Train
train(runname = "Combined prediction",
only_linear = FALSE)
Error in { :
task 1 failed - "unused arguments (newdata = list(c(-1.93168078800026, -1.92505439169727, -1.73861676829675, -1.70758217144704, -1.91975684387195, -1.99588761789738, -2.01016499496625, -2.02379005065133, -2.0738679664727, -2.09042068029056, -2.02469272600033, -1.9532551984751, -1.92903428398442, -1.7727665735043, -1.70782203692347, -1.65397925751084, -1.60795537344207, -1.63335829909637, -1.60448384112033, -1.55650025550981, -1.50606712040359, -1.40233581968582, -1.333916922279, -1.43675011679354, -1.54260525821538, -1.67125244832142,
-1.79359415857199, -1.8530093145463, -2.04810651605745, -2.14524600704668, -2.15189296939762, -2.15647784789255, -2.22220024484918, -2.25294869772256, -2.14733133777705, -2.15867029427131, -2.19162297350525, -2.13085110411295, -1.96465055016459, -1.83387463222748, -1.67105924292237, -1.58961747535737, -1.61047172299883, -1.61022006790944, -1.61688190719595, -1.51371195679359, -1.42725549060479, -1.33465129260574, -1.16207506811305, -1.2490927369
I feel like I could easily be missing some necessary options, so maybe this is an easy fix.
R version 4.3.0 (2023-04-21 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)
Matrix products: default
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] INLA_23.09.09 sp_1.6-0 matrixStats_1.0.0 dbarts_0.9-23 assertthat_0.2.1
[6] igraph_1.4.2 terra_1.7-29 xgboost_1.7.5.1 glmnet_4.1-7 Matrix_1.5-4
[11] inlabru_2.9.0 fmesher_0.1.2 sf_1.0-12 lubridate_1.9.2 forcats_1.0.0
[16] stringr_1.5.0 dplyr_1.1.2 purrr_1.0.1 readr_2.1.4 tidyr_1.3.0
[21] tibble_3.2.1 ggplot2_3.4.3 tidyverse_2.0.0 ibis.iSDM_0.0.8
loaded via a namespace (and not attached):
[1] DBI_1.1.3 remotes_2.4.2 readxl_1.4.2 rlang_1.1.0
[5] magrittr_2.0.3 e1071_1.7-13 compiler_4.3.0 vctrs_0.6.2
[9] rgbif_3.7.7 httpcode_0.3.0 pkgconfig_2.0.3 shape_1.4.6
[13] crayon_1.5.2 taxize_0.9.100 fastmap_1.1.1 lwgeom_0.2-13
[17] utf8_1.2.3 rmarkdown_2.21 tzdb_0.3.0 bit_4.0.5
[21] xfun_0.39 embarcadero_1.2.0.1003 jsonlite_1.8.4 reshape_0.8.9
[25] uuid_1.1-1 parallel_4.3.0 R6_2.5.1 stringi_1.7.12
[29] cellranger_1.1.0 stars_0.6-3 Rcpp_1.0.10 iterators_1.0.14
[33] knitr_1.42 zoo_1.8-12 Metrics_0.1.4 splines_4.3.0
[37] timechange_0.2.0 tidyselect_1.2.0 rstudioapi_0.14 abind_1.4-5
[41] yaml_2.3.7 codetools_0.2-19 curl_5.0.0 lattice_0.21-8
[45] plyr_1.8.8 withr_2.5.0 evaluate_0.20 survival_3.5-5
[49] units_0.8-1 proxy_0.4-27 xml2_1.3.3 pillar_1.9.0
[53] whisker_0.4.1 KernSmooth_2.23-20 foreach_1.5.2 generics_0.1.3
[57] vroom_1.6.1 hms_1.1.3 munsell_0.5.0 scales_1.2.1
[61] rgdal_1.6-6 class_7.3-21 glue_1.6.2 lazyeval_0.2.2
[65] tools_4.3.0 data.table_1.14.8 grid_4.3.0 bold_1.2.0
[69] ape_5.7-1 colorspace_2.1-0 nlme_3.1-162 raster_3.6-20
[73] conditionz_0.1.0 proto_1.0.0 cli_3.6.1 fansi_1.0.4
[77] gtable_0.3.4 oai_0.4.0 digest_0.6.31 classInt_0.4-9
[81] crul_1.3 htmltools_0.5.5 lifecycle_1.0.3 dismo_1.3-9
[85] httr_1.4.5 bit64_4.0.5