Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue Jul 25, 2022 · 8 comments
Assignees

Comments

@haniehsaeedi
Copy link

i <- which(as.vector(shoredistances) < (-1*buffer))

@haniehsaeedi haniehsaeedi changed the title 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. I get an error ''Error in which(as.vector(shoredistances) < (-1 * buffer)) : 'list' object cannot be coerced to type 'double' 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. Jul 25, 2022
@pieterprovoost
Copy link
Member

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

@haniehsaeedi
Copy link
Author

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
Copy link
Member

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

@haniehsaeedi
Copy link
Author

haniehsaeedi commented Jul 25, 2022

data.csv
Thanks a lot @pieterprovoost !

@pieterprovoost
Copy link
Member

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

@haniehsaeedi
Copy link
Author

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
Copy link

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.

@pieterprovoost pieterprovoost self-assigned this Oct 13, 2022
@ocefpaf
Copy link

ocefpaf commented Mar 8, 2023

This is fixed in the un-merged PR #88 BTW

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants