mapdeck R when using fill_colour the session crashes in Rstudio - r

As the title says when I use the fill_colour parameter my session crashes.
For example if I take from the Colours section of the mapdeck site and run
library(mapdeck)
library(sf)
sf <- spatialwidget::widget_melbourne
mapdeck() %>%
add_polygon(
data = sf
, fill_colour = "SA2_NAME"
)
Then the system crashes with "R Session Aborted"
If I amend the above to just
library(mapdeck)
library(sf)
sf <- spatialwidget::widget_melbourne
mapdeck() %>%
add_polygon(
data = sf
)
then the plot comes out without an error.
If I go to the logs from the help menu in Rstudio then there's nothing about the crash.
What should I be checking, removing, reinstalling, etc?
sessionInfo()
R version 4.2.0 (2022-04-22 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United States.utf8 LC_MONETARY=English_United States.utf8 LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] units_0.8-0 dplyr_1.0.9 jsonify_1.2.1 RColorBrewer_1.1-3 sf_1.0-8 mapdeck_0.3.4 stringr_1.4.0 arrow_8.0.0
[9] webshot2_0.1.0 ggplot2_3.3.6 glue_1.6.2 magrittr_2.0.3 flextable_0.7.0 data.table_1.14.2 lubridate_1.8.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.8.3 class_7.3-20 ps_1.7.0 assertthat_0.2.1 digest_0.6.29 utf8_1.2.2 R6_2.5.1 evaluate_0.15
[9] e1071_1.7-9 pillar_1.7.0 gdtools_0.2.4 rlang_1.0.2 uuid_1.1-0 rmarkdown_2.14 htmlwidgets_1.5.4 bit_4.0.4
[17] munsell_0.5.0 proxy_0.4-26 compiler_4.2.0 xfun_0.31 pkgconfig_2.0.3 systemfonts_1.0.4 base64enc_0.1-3 htmltools_0.5.2
[25] spatialwidget_0.2.3 websocket_1.4.1 tidyselect_1.1.2 tibble_3.1.7 fansi_1.0.3 crayon_1.5.1 withr_2.5.0 later_1.3.0
[33] grid_4.2.0 jsonlite_1.8.0 gtable_0.3.0 lifecycle_1.0.1 DBI_1.1.2 scales_1.2.0 KernSmooth_2.23-20 zip_2.2.0
[41] cli_3.3.0 stringi_1.7.6 promises_1.2.0.1 xml2_1.3.3 ellipsis_0.3.2 generics_0.1.2 vctrs_0.4.1 tools_4.2.0
[49] bit64_4.0.5 officer_0.4.2 purrr_0.3.4 processx_3.5.3 fastmap_1.1.0 yaml_2.3.5 chromote_0.1.0 colorspace_2.0-3
[57] classInt_0.4-3 knitr_1.39

Related

Tidyr's crossing() function not producing expected names in output

I apologize in advance that I could not create a reproducible example, but when I do tidyr::crossing on some dataframes, I get a crossed tibble where the x variables have the form: x$col_name and the y variables have y$col_name. If I do:
crossing(iris,mtcars)
I get names that don't have the x$ prefix, as desired. I checked that the class of the input dataframes are the same as the example above, and there are no duplicate names in the example I'm working with. I can't share the data for the usual privacy reasons. I realize there is not much to work with here, but I'm hoping someone here is experience enough with tidyr to understand this issue.
Here is some session info:
R version 4.2.0 (2022-04-22 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United States.utf8
[3] LC_MONETARY=English_United States.utf8 LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] writexl_1.4.0 readxl_1.4.0 lubridate_1.8.0 forcats_0.5.1 stringr_1.4.0 dplyr_1.0.9
[7] purrr_0.3.4 readr_2.1.2 tidyr_1.2.0 tibble_3.1.7 ggplot2_3.3.6 tidyverse_1.3.1
loaded via a namespace (and not attached):
[1] cellranger_1.1.0 pillar_1.7.0 compiler_4.2.0 dbplyr_2.2.0 tools_4.2.0
[6] jsonlite_1.8.0 lifecycle_1.0.1 gtable_0.3.0 pkgconfig_2.0.3 rlang_1.0.2
[11] reprex_2.0.1 rstudioapi_0.13 DBI_1.1.3 cli_3.3.0 haven_2.5.0
[16] xml2_1.3.3 withr_2.5.0 httr_1.4.3 fs_1.5.2 generics_0.1.2
[21] vctrs_0.4.1 hms_1.1.1 grid_4.2.0 tidyselect_1.1.2 glue_1.6.2
[26] R6_2.5.1 fansi_1.0.3 tzdb_0.3.0 modelr_0.1.8 magrittr_2.0.3
[31] backports_1.4.1 scales_1.2.0 ellipsis_0.3.2 rvest_1.0.2 assertthat_0.2.1
[36] colorspace_2.0-3 utf8_1.2.2 stringi_1.7.6 munsell_0.5.0 broom_0.8.0
[41] crayon_1.5.1
Okay, the answer is simple:
crossing(iris,mtcars)
crossing(x = iris,y = mtcars)
This is rather odd behavior in my opinion.

dimdesc() error from FactoMineR package in the building of PCA

Using the data available on FactoMineR package: (http://factominer.free.fr/book/orange.csv), I created a PCA and after a PCA with supplementary information. The latter step when I used the function dimdesc() I obtained an error that surfing through internet I was not able to find a way to solve it.
I post here if someone could help me. I attach below my code. Thanks on advance for your comments/hints.
data_orange<-read.delim("orange.csv", header = T, sep = ";")
data_orange_subset <- data_orange[,1:8]
res.pca<-PCA(data_orange_subset, graph = F)
dimdesc(res.pca,axes=1:2)
--> This works
When considering supplementary information in the PCA:
data_orange_2 <- data_orange[,-c(16,17)]
res.pca.all <- PCA(data_orange_2, graph = F,
quanti.sup = 9:15,
quali.sup = 1)
dimdesc(res.pca.all, axes = 1:2)
Error in if (sum(tabF[, 2] <= proba) > 0) resF <- tabF[tabF[, 2] <= proba, :
missing value where TRUE/FALSE needed
I've checked for NA values in dataframe but it is not the case.
SessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Linux Mint 19.1
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
locale:
[1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C LC_TIME=en_GB.UTF-8
[4] LC_COLLATE=en_GB.UTF-8 LC_MONETARY=es_ES.UTF-8 LC_MESSAGES=en_GB.UTF-8
[7] LC_PAPER=es_ES.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=es_ES.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] factoextra_1.0.7.999 ggplot2_3.3.6 FactoMineR_2.4
loaded via a namespace (and not attached):
[1] ggrepel_0.9.1 Rcpp_1.0.8.3 lattice_0.20-45 tidyr_1.2.0
[5] assertthat_0.2.1 digest_0.6.29 utf8_1.2.2 R6_2.5.1
[9] backports_1.4.1 evaluate_0.15 pillar_1.7.0 rlang_1.0.3
[13] rstudioapi_0.13 minqa_1.2.4 car_3.1-0 nloptr_2.0.3
[17] Matrix_1.4-1 DT_0.23 rmarkdown_2.13 labeling_0.4.2
[21] splines_4.1.2 lme4_1.1-29 htmlwidgets_1.5.4 munsell_0.5.0
[25] broom_0.8.0 compiler_4.1.2 xfun_0.31 pkgconfig_2.0.3
[29] faraway_1.0.7 htmltools_0.5.2 flashClust_1.01-2 tidyselect_1.1.2
[33] tibble_3.1.7 gridExtra_2.3 dendextend_1.15.2 viridisLite_0.4.0
[37] fansi_1.0.3 crayon_1.5.1 dplyr_1.0.9 withr_2.5.0
[41] ggpubr_0.4.0 MASS_7.3-56 leaps_3.1 grid_4.1.2
[45] nlme_3.1-157 gtable_0.3.0 lifecycle_1.0.1 DBI_1.1.2
[49] magrittr_2.0.3 scales_1.2.0 cli_3.3.0 carData_3.0-5
[53] farver_2.1.0 ggsignif_0.6.3 viridis_0.6.2 scatterplot3d_0.3-41
[57] ellipsis_0.3.2 generics_0.1.2 vctrs_0.4.1 boot_1.3-28
[61] ggsci_2.9 tools_4.1.2 glue_1.6.2 purrr_0.3.4
[65] abind_1.4-5 fastmap_1.1.0 yaml_2.3.5 colorspace_2.0-3
[69] cluster_2.1.3 rstatix_0.7.0 knitr_1.39

Any error found in R responds with Error in app$vspace(new_style$`margin-top` %||% 0) : attempt to apply non-function

I honestly don't know how to make this reproducible. Any error that occurs in R, using tidyverse throws:
Error in app$vspace(new_style$`margin-top` %||% 0) :
attempt to apply non-function
Has anybody else seen this?
Edit:
Here is the sessionInfo() output:
R version 4.0.4 (2021-02-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)
Matrix products: default
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252 LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] rstatix_0.7.0 plotly_4.10.0 ggpubr_0.4.0 forcats_0.5.1 stringr_1.4.0 dplyr_1.0.4 purrr_0.3.4 readr_2.1.2 tidyr_1.2.0 tibble_3.0.6
[11] ggplot2_3.3.5 tidyverse_1.3.1
loaded via a namespace (and not attached):
[1] Rcpp_1.0.8.3 lubridate_1.7.10 assertthat_0.2.1 digest_0.6.29 utf8_1.1.4 R6_2.5.1 cellranger_1.1.0 backports_1.2.1 reprex_2.0.1
[10] evaluate_0.15 httr_1.4.2 pillar_1.7.0 rlang_1.0.2 lazyeval_0.2.2 readxl_1.3.1 rstudioapi_0.13 data.table_1.14.2 car_3.0-12
[19] rmarkdown_2.13 labeling_0.4.2 htmlwidgets_1.5.4 munsell_0.5.0 broom_0.7.12 xfun_0.30 compiler_4.0.4 modelr_0.1.8 pkgconfig_2.0.3
[28] htmltools_0.5.2 tidyselect_1.1.2 fansi_0.4.2 viridisLite_0.4.0 crayon_1.5.1 tzdb_0.3.0 dbplyr_2.1.1 withr_2.5.0 grid_4.0.4
[37] jsonlite_1.7.2 gtable_0.3.0 lifecycle_1.0.1 DBI_1.1.2 magrittr_2.0.1 scales_1.1.1 cli_3.2.0 stringi_1.5.3 carData_3.0-5
[46] farver_2.1.0 ggsignif_0.6.3 fs_1.5.0 xml2_1.3.2 ellipsis_0.3.2 generics_0.1.2 vctrs_0.4.0 tools_4.0.4 glue_1.4.2
[55] hms_1.1.1 yaml_2.3.5 abind_1.4-5 fastmap_1.1.0 colorspace_2.0-0 rvest_1.0.2 knitr_1.38 haven_2.3.1

Pool and RMySQL suddenly using the wrong encoding

I've been regularly loading data from my company database. Yesterday I installed R 4.1.3. Since then, the encoding of the data I load using pool is messed up. Not sure what encoding is used, but I'd need UTF-8.
I checked on my colleague's computer, who is still running R 4.1.2, and with the exact same code he doesn't have that issue. Any idea why? And possibly if I can set a global parameter for that?
My session info:
> sessionInfo()
R version 4.1.3 (2022-03-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22000)
Matrix products: default
locale:
[1] LC_COLLATE=English_Switzerland.1252 LC_CTYPE=English_Switzerland.1252 LC_MONETARY=English_Switzerland.1252 LC_NUMERIC=C
[5] LC_TIME=English_Switzerland.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] showtext_0.9-5 showtextdb_3.0 sysfonts_0.8.8 ggnewscale_0.4.6 scales_1.1.1 hrbrthemes_0.8.0 ggthemes_4.2.4 pool_0.1.6
[9] highcharter_0.9.4 reshape2_1.4.4 lubridate_1.8.0 zoo_1.8-9 viridis_0.6.2 viridisLite_0.4.0 forcats_0.5.1 stringr_1.4.0
[17] dplyr_1.0.8 purrr_0.3.4 readr_2.1.2 tidyr_1.2.0 tibble_3.1.6 ggplot2_3.3.5 tidyverse_1.3.1
loaded via a namespace (and not attached):
[1] httr_1.4.2 RMySQL_0.10.23 jsonlite_1.8.0 modelr_0.1.8 assertthat_0.2.1 TTR_0.24.3 cellranger_1.1.0 yaml_2.3.5
[9] gdtools_0.2.4 Rttf2pt1_1.3.10 pillar_1.7.0 backports_1.4.1 lattice_0.20-45 glue_1.6.2 rlist_0.4.6.2 extrafontdb_1.0
[17] digest_0.6.29 rvest_1.0.2 colorspace_2.0-3 htmltools_0.5.2 plyr_1.8.6 pkgconfig_2.0.3 broom_0.7.12 haven_2.4.3
[25] later_1.3.0 tzdb_0.2.0 generics_0.1.2 ellipsis_0.3.2 withr_2.5.0 cli_3.2.0 quantmod_0.4.18 magrittr_2.0.2
[33] crayon_1.5.0 readxl_1.3.1 evaluate_0.15 fs_1.5.2 fansi_1.0.2 xts_0.12.1 xml2_1.3.3 data.table_1.14.2
[41] tools_4.1.3 hms_1.1.1 lifecycle_1.0.1 munsell_0.5.0 reprex_2.0.1 compiler_4.1.3 systemfonts_1.0.4 rlang_1.0.2
[49] grid_4.1.3 rstudioapi_0.13 htmlwidgets_1.5.4 igraph_1.2.11 rmarkdown_2.13 gtable_0.3.0 DBI_1.1.2 curl_4.3.2
[57] R6_2.5.1 gridExtra_2.3 knitr_1.37 fastmap_1.1.0 extrafont_0.17 utf8_1.2.2 stringi_1.7.6 Rcpp_1.0.8.3

Markers not appearing on map using leaflet package in R - with basic example

I'm trying to use the leaflet package in R to produce an interactive map. Everything was working for me about a month ago, but now my map is appearing but I can't get the markers to appear. I tried using a simple example I found online but this has the same issue. I tried updating R, R studio, and all of my packages. I also tried the github development version of leaflet to no avail. Running this in an .Rmd file (also tried in a regular script). Please let me know if anyone has any ideas, thank you! My code:
library(leaflet)
leaflet() %>%
addTiles() %>%
addMarkers(lng=174.768, lat=-36.852, popup="The birthplace of R")
My output:
I got the code from this site which shows what it's supposed to look like: https://rstudio.github.io/leaflet/
Session Info:
R version 4.1.3 (2022-03-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)
Matrix products: default
locale:
[3] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[3] stats graphics grDevices utils datasets methods base
other attached packages:
[3] leaflet_2.1.0 lindia_0.9 ggannotate_0.1.0.900 shiny_1.7.1 esquisse_1.1.0 readxl_1.3.1
[7] haven_2.4.3 forcats_0.5.1 stringr_1.4.0 dplyr_1.0.8 purrr_0.3.4 readr_2.1.2
[13] tidyr_1.2.0 tibble_3.1.6 ggplot2_3.3.5 tidyverse_1.3.1
loaded via a namespace (and not attached):
[3] colorspace_2.0-3 ellipsis_0.3.2 rio_0.5.29 rprojroot_2.0.2 parameters_0.17.0 fs_1.5.2
[7] mc2d_0.1-21 rstudioapi_0.13 farver_2.1.0 remotes_2.4.2 ggrepel_0.9.1 DT_0.21
[13] fansi_1.0.2 mvtnorm_1.1-3 lubridate_1.8.0 xml2_1.3.3 splines_4.1.3 cachem_1.0.6
[19] knitr_1.37 pkgload_1.2.4 zeallot_0.1.0 jsonlite_1.8.0 broom_0.7.12 dbplyr_2.1.1
[25] ggdist_3.1.1 clipr_0.8.0 compiler_4.1.3 httr_1.4.2 backports_1.4.1 assertthat_0.2.1
[31] Matrix_1.4-0 fastmap_1.1.0 cli_3.2.0 later_1.3.0 prettyunits_1.1.1 htmltools_0.5.2
[37] tools_4.1.3 ggstatsplot_0.9.1 gtable_0.3.0 glue_1.6.2 Rcpp_1.0.8.3 cellranger_1.1.0
[43] jquerylib_0.1.4 vctrs_0.3.8 nlme_3.1-155 crosstalk_1.2.0 insight_0.16.0 xfun_0.30
[49] brio_1.1.3 ps_1.6.0 testthat_3.1.2 openxlsx_4.2.5 rvest_1.0.2 mime_0.12
[55] miniUI_0.1.1.1 lifecycle_1.0.1 devtools_2.4.3 MASS_7.3-55 scales_1.1.1 hms_1.1.1
[61] promises_1.2.0.1 rematch2_2.1.2 RColorBrewer_1.1-2 yaml_2.3.5 curl_4.3.2 memoise_2.0.1
[67] gridExtra_2.3 datamods_1.2.0 sass_0.4.0 reshape_0.8.8 stringi_1.7.6 paletteer_1.4.0
[73] bayestestR_0.11.5 desc_1.4.1 pkgbuild_1.3.1 zip_2.2.0 rlang_1.0.2 pkgconfig_2.0.3
[79] distributional_0.3.0 lattice_0.20-45 patchwork_1.1.1 htmlwidgets_1.5.4 labeling_0.4.2 processx_3.5.2
[85] tidyselect_1.1.2 plyr_1.8.6 magrittr_2.0.2 R6_2.5.1 generics_0.1.2 DBI_1.1.2
[91] pillar_1.7.0 foreign_0.8-82 withr_2.5.0 mgcv_1.8-39 datawizard_0.3.0 performance_0.8.0
[97] modelr_0.1.8 crayon_1.5.0 WRS2_1.1-3 shinyWidgets_0.6.4 utf8_1.2.2 correlation_0.8.0
[103] tzdb_0.2.0 usethis_2.1.5 grid_4.1.3 data.table_1.14.2 callr_3.7.0 reprex_2.0.1
[109] digest_0.6.29 xtable_1.8-4 httpuv_1.6.5 statsExpressions_1.3.0 munsell_0.5.0 viridisLite_0.4.0
I had the same result, and search for other example.
This one works
library(leaflet)
data(quakes)
leaflet(quakes) %>% addTiles() %>% addMarkers(
clusterOptions = markerClusterOptions()
)

Resources