riatelab/mapsf

Error example Label Map

flodebarre opened this issue · 5 comments

Hi,
Thanks for developing and providing this resource.

I am learing how to use it, and following the examples provided on this page.

FYI, Code in section "Label Map" does not work on my machine: the map is shown, with white labels, but the evaluation continues and eventually aborts with the error message

Error in getNamespace("grDevices") : 
  Shadow graphics device error: r error 4 (R code execution error)

Screenshot 2021-07-29 at 08 20 58

I use R version 4.0.4 (2021-02-15) on Rstudio Version 1.4.1717.

Hi,
I'm unable to reproduce this at the moment.
Does it work outside RStudio, using just R?
Can you provide your full sessionInfo() output?

I just tried, it is working in R outside of Rstudio. Maybe a memory issue?

Screenshot 2021-07-29 at 09 07 56

Voilà

> sessionInfo()
R version 4.0.4 (2021-02-15)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 11.4

Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/POSIX/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] mapsf_0.2.0 sf_1.0-2   

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.7         knitr_1.31         magrittr_2.0.1     units_0.7-2       
 [5] tidyselect_1.1.0   R6_2.5.0           rlang_0.4.10       fansi_0.4.2       
 [9] dplyr_1.0.5        tools_4.0.4        grid_4.0.4         xfun_0.22         
[13] utf8_1.2.1         KernSmooth_2.23-18 e1071_1.7-7        DBI_1.1.1         
[17] ellipsis_0.3.1     htmltools_0.5.1.1  class_7.3-18       yaml_2.2.1        
[21] digest_0.6.27      tibble_3.1.0       lifecycle_1.0.0    crayon_1.4.1      
[25] purrr_0.3.4        vctrs_0.3.6        glue_1.4.2         evaluate_0.14     
[29] rmarkdown_2.7      proxy_0.4-26       pillar_1.5.1       compiler_4.0.4    
[33] generics_0.1.0     classInt_0.4-3     pkgconfig_2.0.3

I'm not sure.
It may have something to do with the graphic device backend of RStudio:
image
You can try to modify this and see if it works.
The next steps would be

  • re-install RStudio
  • to update all R packages (if needed).
  • to update R itself (to the next minor version, hence reinstalling all packages...)

Hi,
Has mf_label() finally worked on your machine with RStudio?

Yes, thanks for asking! The issue was with RStudio