Running compare_covariates stops with the following error for both the spermwhales dataset or own data:
Error: Column names extrapolation.univariate.n, extrapolation.univariate.n, extrapolation.univariate.n, extrapolation.univariate.n, extrapolation.univariate.n, and 10 more must not be duplicated.
Run rlang::last_error() to see where the error occurred.
Output of rlang::last_error() attached below. I could not trace the issue based on the provided traceback.
Running the code elemnets the error is thrown in line 446 & 449
I believe .f is expecting a numeric class without attr., and indeed the following works:
var.ind.univariate <- purrr::map_df(.x = var.ind, .f = ~as.numeric(vars.univariate[.])) %>% tidyr::gather(data = .)
Tracing the origin of the vars.univariate variable, it is based on the output of retrieve numbers of cells from the extrapolation, lines 213-219, with the following code:
Running compare_covariates stops with the following error for both the spermwhales dataset or own data:
Output of rlang::last_error() attached below. I could not trace the issue based on the provided traceback.
Running the code elemnets the error is thrown in line 446 & 449
`if(extrapolation.type=="both"){
I believe .f is expecting a numeric class without attr., and indeed the following works:
var.ind.univariate <- purrr::map_df(.x = var.ind, .f = ~as.numeric(vars.univariate[.])) %>% tidyr::gather(data = .)
Tracing the origin of the vars.univariate variable, it is based on the output of retrieve numbers of cells from the extrapolation, lines 213-219, with the following code:
vars <- exsum %>% purrr::map(.x = ., .f = ~.x[names(.x)%in%paste0(extype, ".n")]) %>% unlist(.)
Setting the function unlist(.), with unlist(. , use.names = FALSE) solves the issue for me.
sessionInfo() R version 3.6.1 (2019-07-05) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 18362)
Matrix products: default
locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages: [1] stats graphics grDevices utils datasets methods base
other attached packages: [1] ggplot2_3.3.1 dsmextra_1.1.0 dismo_1.1-4 raster_3.1-5
[5] sp_1.4-2 sf_0.9-3 dplyr_1.0.0 ProjectTemplate_0.9.2
loaded via a namespace (and not attached): [1] xfun_0.14 tidyselect_1.1.0 remotes_2.1.1 purrr_0.3.4 lattice_0.20-38
[6] colorspace_1.4-1 vctrs_0.3.1 generics_0.0.2 htmltools_0.4.0 utf8_1.1.4
[11] rlang_0.4.6 pkgbuild_1.0.8 startup_0.14.1 e1071_1.7-3 pillar_1.4.4
[16] glue_1.4.1 withr_2.2.0 DBI_1.1.0 lifecycle_0.2.0 plyr_1.8.6
[21] munsell_0.5.0 gtable_0.3.0 htmlwidgets_1.5.1 codetools_0.2-16 labeling_0.3
[26] knitr_1.28 callr_3.4.3 ps_1.3.3 crosstalk_1.1.0.1 curl_4.3
[31] class_7.3-15 fansi_0.4.1 highr_0.8 Rcpp_1.0.4.6 KernSmooth_2.23-15 [36] backports_1.1.7 scales_1.1.1 classInt_0.4-3 leaflet_2.0.3 farver_2.0.3
[41] packrat_0.4.8-1 digest_0.6.25 processx_3.4.2 cowplot_1.0.0 grid_3.6.1
[46] rprojroot_1.3-2 here_0.1 rgdal_1.5-8 cli_2.0.2 tools_3.6.1
[51] magrittr_1.5 tibble_3.0.1 crayon_1.3.4 tidyr_1.1.0 pkgconfig_2.0.3
[56] ellipsis_0.3.1 prettyunits_1.1.1 assertthat_0.2.1 rstudioapi_0.11 R6_2.4.1
[61] units_0.6-6 compiler_3.6.1
Running rlang::last_error() gives