habitus-eu / HabitusGUI

Rshiny GUI
Apache License 2.0
3 stars 4 forks source link

Error and warning while building trajectories [hbGIS] #107

Open josefheidler opened 5 months ago

josefheidler commented 5 months ago

This problem occurs while processing files with hbGIS inside HabitusGUI.

The warning has probably something to do with a deprecated feature as it says in the error. However, the error seems to be related to a different problem.

<<< building trajectories...
Error in `[[<-`(`*tmp*`, sf_column, value = structure(list(structure(c(10.407946,  : 
  Assigned data `value` must be compatible with existing data.
✖ Existing data has 6588 rows.
✖ Assigned data has 6590 rows.
ℹ Only vectors of size 1 are recycled.
Caused by error in `vectbl_recycle_rhs_rows()`:
! Can't recycle input of size 6590 to size 6588.
In addition: Warning message:
Returning more (or less) than 1 row per `summarise()` group was deprecated in
dplyr 1.1.0.
ℹ Please use `reframe()` instead.
ℹ When switching from `summarise()` to `reframe()`, remember that `reframe()`
  always returns an ungrouped data frame and adjust accordingly.
ℹ The deprecated feature was likely used in the hbGIS package.
  Please report the issue to the authors. 
vincentvanhees commented 5 months ago

This is an unfortunate side issue of the otherwise excellent palmsplusr code that hbGIS is based on. The dependencies of this code have the annoying habit of changing their interface frequently. Maintainers announce these changes but it remains a pain. I will investigate and try to address, but I cannot promise that we do not have a similar warning in a month time. The best solution would be to get rit of these dependencies, but that takes time.

josefheidler commented 5 months ago

Yes, I can relate to what you are saying. What bothers me more is the error. Can you investigate that? More importantly, do you think the results are wrong because of it?

vincentvanhees commented 5 months ago

I am trying to reproduce the error but without success in the NBBB2010 dataset. Also I am not getting the warning.

What dataset should I use instead to test this?

Could it be that we are using different dependencies?

See below all my other loaded libraries, not sure all of them are needed for what we are doing but just for completeness.

> sessionInfo()
R version 4.3.3 (2024-02-29 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 11 x64 (build 22631)

Matrix products: default

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

time zone: Europe/Amsterdam
tzcode source: internal

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

other attached packages:
[1] shiny_1.8.1.1

loaded via a namespace (and not attached):
 [1] tidyr_1.3.1        sass_0.4.9         utf8_1.2.4         generics_0.1.3    
 [5] class_7.3-22       KernSmooth_2.23-22 lattice_0.22-5     hms_1.1.3         
 [9] digest_0.6.35      magrittr_2.0.3     hbGPS_0.0.6        grid_4.3.3        
[13] fastmap_1.1.1      jsonlite_1.8.8     processx_3.8.4     e1071_1.7-14      
[17] brio_1.1.4         DBI_1.2.2          ps_1.7.6           promises_1.3.0    
[21] purrr_1.0.2        fansi_1.0.6        crosstalk_1.2.1    hbGIS_0.0.1       
[25] jquerylib_0.1.4    cli_3.6.2          rlang_1.1.3        units_0.8-5       
[29] yaml_2.3.8         cachem_1.0.8       GGIR_3.0-10        tools_4.3.3       
[33] tzdb_0.4.0         geosphere_1.5-19   GGIRread_1.0.0     memoise_2.0.1     
[37] dplyr_1.1.4        httpuv_1.6.15      DT_0.33            vctrs_0.6.5       
[41] R6_2.5.1           mime_0.12          proxy_0.4-27       lifecycle_1.0.4   
[45] classInt_0.4-10    HabitusGUI_0.3.2   fs_1.6.3           shinyFiles_0.9.3  
[49] htmlwidgets_1.6.4  fontawesome_0.5.2  shinyjs_2.1.0      pkgconfig_2.0.3   
[53] callr_3.7.6        pillar_1.9.0       bslib_0.7.0        later_1.3.2       
[57] rsconnect_1.2.2    data.table_1.15.4  glue_1.7.0         Rcpp_1.0.12       
[61] sf_1.0-16          tibble_3.2.1       tidyselect_1.2.1   rstudioapi_0.16.0 
[65] palmsplusr_0.4.0   xtable_1.8-4       htmltools_0.5.8.1  readr_2.1.5       
[69] testthat_3.2.1.1   compiler_4.3.3     sp_2.1-3   
josefheidler commented 5 months ago

1) I used some IPEN data (processing the whole country).

2) We are using the same packages.

image

3) The error could be only for one participant, who might have some missing data. I think I can check that later in the analysis.

4) I will process all IPEN data for all the countries again and let you know if the error comes up again for different sets of files. We can then find a reason why it is happening.

5) Can you please look at the https://github.com/habitus-eu/HabitusGUI/issues/108

Thanks!