iobis / obistools

Tools for data enhancement and quality control
https://iobis.github.io/obistools
Other
25 stars 6 forks source link

This gives the error ''Error in which(as.vector(shoredistances) < (-1 * buffer)) : 'list' object cannot be coerced to type 'double' , and ''unlist'' should be added before the shoreline. #89

Open haniehsaeedi opened 2 years ago

haniehsaeedi commented 2 years ago

https://github.com/iobis/obistools/blob/d039b4bb23dd130372dd34585a23f800934750c1/R/check_onland.R#L53

pieterprovoost commented 2 years ago

Thanks @haniehsaeedi, can you please share a minimal code example?

haniehsaeedi commented 2 years ago

library(devtools) library(obistools) data <- read.csv("data.csv") plot_map(data, zoom = TRUE) plot_map_leaflet(data) check_onland(data, report = TRUE, buffer = 100)

pieterprovoost commented 2 years ago

Would you mind adding your data file or letting me know what the output is of str(data)?

haniehsaeedi commented 2 years ago

data.csv Thanks a lot @pieterprovoost !

pieterprovoost commented 2 years ago

I'm not able to reproduce the issue, can you please share the output of sessionInfo()? Thanks!

haniehsaeedi commented 2 years ago

sessionInfo() R version 4.2.1 (2022-06-23 ucrt) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19044)

Matrix products: default

locale: [1] LC_COLLATE=English_Germany.utf8 LC_CTYPE=English_Germany.utf8
[3] LC_MONETARY=English_Germany.utf8 LC_NUMERIC=C
[5] LC_TIME=English_Germany.utf8

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] obistools_0.0.10 devtools_2.4.4 usethis_2.1.6

loaded via a namespace (and not attached): [1] httr_1.4.3 rnaturalearth_0.1.0 maps_3.4.0
[4] pkgload_1.3.0 tidyr_1.2.0 jsonlite_1.8.0
[7] shiny_1.7.2 assertthat_0.2.1 sp_1.5-0
[10] yaml_2.3.5 remotes_2.4.2 sessioninfo_1.2.2
[13] pillar_1.8.0 lattice_0.20-45 glue_1.6.2
[16] digest_0.6.29 promises_1.2.0.1 leaflet.providers_1.9.0 [19] colorspace_2.0-3 htmltools_0.5.3 httpuv_1.6.5
[22] pkgconfig_2.0.3 purrr_0.3.4 xtable_1.8-4
[25] scales_1.2.0 processx_3.7.0 later_1.3.0
[28] mapedit_0.6.0 tzdb_0.3.0 tibble_3.1.8
[31] proxy_0.4-27 farver_2.1.1 generics_0.1.3
[34] ggplot2_3.3.6 ellipsis_0.3.2 cachem_1.0.6
[37] cli_3.3.0 magrittr_2.0.3 crayon_1.5.1
[40] mime_0.12 evaluate_0.15 memoise_2.0.1
[43] ps_1.7.1 data.tree_1.0.0 fs_1.5.2
[46] fansi_1.0.3 forcats_0.5.1 xml2_1.3.3
[49] class_7.3-20 pkgbuild_1.3.1 profvis_0.3.7
[52] tools_4.2.1 data.table_1.14.2 prettyunits_1.1.1
[55] geosphere_1.5-14 hms_1.1.1 lifecycle_1.0.1
[58] stringr_1.4.0 munsell_0.5.0 callr_3.7.1
[61] compiler_4.2.1 e1071_1.7-11 rlang_1.0.4
[64] classInt_0.4-7 units_0.8-0 grid_4.2.1
[67] robis_2.8.2 rstudioapi_0.13 rappdirs_0.3.3
[70] htmlwidgets_1.5.4 crosstalk_1.2.0 miniUI_0.1.1.1
[73] labeling_0.4.2 rmarkdown_2.14 gtable_0.3.0
[76] DBI_1.1.3 curl_4.3.2 R6_2.5.1
[79] knitr_1.39 dplyr_1.0.9 rgeos_0.5-9
[82] fastmap_1.1.0 utf8_1.2.2 KernSmooth_2.23-20
[85] readr_2.1.2 stringi_1.7.8 Rcpp_1.0.9
[88] vctrs_0.4.1 sf_1.0-8 xfun_0.31
[91] leaflet_2.1.1 tidyselect_1.1.2 urlchecker_1.0.1

ameliabridges commented 2 years ago

Hi, was this issue resolved? I've just revisited code from June code and I get the same error when running the check_onland() function. Thanks.

ocefpaf commented 1 year ago

This is fixed in the un-merged PR https://github.com/iobis/obistools/pull/88 BTW