R rayshader package plot_gg gives blank window - r

I have a problem with converting ggplots into rayshader 3d graphs. I have tested many different examples on the rayshader homepage but it just won't work. For example this code I have from the demonstration examples of the official homepage:
library(rayshader)
library(ggplot2)
mtplot = ggplot(mtcars) +
geom_point(aes(x=mpg,y=disp,color=cyl)) +
scale_color_continuous(limits=c(0,8))
plot_gg(mtplot, width=3.5, multicore = TRUE, windowsize = c(1400,866), sunangle=225,
zoom = 0.60, phi = 30, theta = 45)
When I execute this code the x11 windows opens but it is blank and looks like this. when I use preview=T it works fine since the x11 windows does not open. When I close this blank window my R session is aborted and in the console it says:
pure virtual method called. I have no clue how to get rid of the problem, I could not find anything on the internet so far.
this is my session info:
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041)
Matrix products: default
locale:
[1] LC_COLLATE=German_Germany.1252 LC_CTYPE=German_Germany.1252 LC_MONETARY=German_Germany.1252
[4] LC_NUMERIC=C LC_TIME=German_Germany.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggplot2_3.3.3 rayshader_0.24.11
loaded via a namespace (and not attached):
[1] Rcpp_1.0.6 pillar_1.6.1 compiler_4.1.0 later_1.2.0
[5] prettyunits_1.1.1 iterators_1.0.13 tools_4.1.0 progress_1.2.2
[9] digest_0.6.27 tibble_3.1.2 jsonlite_1.7.2 lifecycle_1.0.0
[13] gtable_0.3.0 pkgconfig_2.0.3 rlang_0.4.11 foreach_1.5.1
[17] DBI_1.1.1 shiny_1.6.0 crosstalk_1.1.1 parallel_4.1.0
[21] xfun_0.23 fastmap_1.1.0 withr_2.4.2 dplyr_1.0.6
[25] knitr_1.33 generics_0.1.0 vctrs_0.3.8 htmlwidgets_1.5.3
[29] hms_1.1.0 tidyselect_1.1.1 manipulateWidget_0.10.1 webshot_0.5.2
[33] grid_4.1.0 glue_1.4.2 R6_2.5.0 fansi_0.4.2
[37] rgl_0.106.8 purrr_0.3.4 magrittr_2.0.1 scales_1.1.1
[41] codetools_0.2-18 promises_1.2.0.1 ellipsis_0.3.2 htmltools_0.5.1.1
[45] assertthat_0.2.1 mime_0.10 xtable_1.8-4 colorspace_2.0-1
[49] httpuv_1.6.1 utf8_1.2.1 miniUI_0.1.1.1 doParallel_1.0.16
[53] munsell_0.5.0 crayon_1.4.1

Related

mapdeck R when using fill_colour the session crashes in Rstudio

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

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

R fable examples not running

I am trying to get started with the fable package in R for forecasting.
I am using the basic examples from their website:
I am trying to run the following example but it doesn't ever run, it runs eternally.
I have upgraded my version of RStudio and have had to restart multiple times but I have had no success.
library(fable)
library(tsibble)
library(tsibbledata)
library(lubridate)
library(dplyr)
aus_retail %>%
filter(
State %in% c("New South Wales", "Victoria"),
Industry == "Department stores"
) %>%
model(
ets = ETS(box_cox(Turnover, 0.3)),
arima = ARIMA(log(Turnover)),
snaive = SNAIVE(Turnover)
) %>%
forecast(h = "2 years") %>%
autoplot(filter(aus_retail, year(Month) > 2010), level = NULL)
Here is my sessioninfo()
> sessionInfo()
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)
Matrix products: default
locale:
[1] LC_COLLATE=English_Ireland.1252 LC_CTYPE=English_Ireland.1252
[3] LC_MONETARY=English_Ireland.1252 LC_NUMERIC=C
[5] LC_TIME=English_Ireland.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_4.0.2 magrittr_2.0.1 ellipsis_0.3.1 cli_2.4.0 tools_4.0.2
[6] pillar_1.5.1 glue_1.4.2 rstudioapi_0.13 tibble_3.1.0 crayon_1.4.1
[11] utf8_1.2.1 fansi_0.4.1 vctrs_0.3.4 hardhat_0.1.5 lifecycle_1.0.0
[16] pkgconfig_2.0.3 rlang_0.4.10
Any suggestions would be appreciated
I updated R to 4.1.0 and my issues have disappeared. I had to include some additional packages such as feasts and urca to remove any errors/warnings post upgrade to 4.1.0
sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)
Matrix products: default
locale:
[1] LC_COLLATE=English_Ireland.1252 LC_CTYPE=English_Ireland.1252
[3] LC_MONETARY=English_Ireland.1252 LC_NUMERIC=C
[5] LC_TIME=English_Ireland.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] urca_1.3-0 feasts_0.2.2 lubridate_1.7.10 tsibbledata_0.3.0 tsibble_1.0.1
[6] fable_0.3.1 fabletools_0.3.1 forcats_0.5.1 stringr_1.4.0 dplyr_1.0.7
[11] purrr_0.3.4 readr_1.4.0 tidyr_1.1.3 tibble_3.1.2 ggplot2_3.3.5
[16] tidyverse_1.3.1
loaded via a namespace (and not attached):
[1] tidyselect_1.1.1 lattice_0.20-44 haven_2.4.1 colorspace_2.0-2
[5] vctrs_0.3.8 generics_0.1.0 utf8_1.2.1 rlang_0.4.11
[9] pillar_1.6.1 glue_1.4.2 withr_2.4.2 DBI_1.1.1
[13] dbplyr_2.1.1 modelr_0.1.8 readxl_1.3.1 distributional_0.2.2
[17] lifecycle_1.0.0 progressr_0.8.0 munsell_0.5.0 gtable_0.3.0
[21] anytime_0.3.9 cellranger_1.1.0 rvest_1.0.0 labeling_0.4.2
[25] fansi_0.5.0 broom_0.7.8 Rcpp_1.0.7 scales_1.1.1
[29] backports_1.2.1 jsonlite_1.7.2 farver_2.1.0 fs_1.5.0
[33] digest_0.6.27 hms_1.1.0 stringi_1.6.2 numDeriv_2016.8-1.1
[37] grid_4.1.0 cli_3.0.1 tools_4.1.0 magrittr_2.0.1
[41] pacman_0.5.1 crayon_1.4.1 pkgconfig_2.0.3 ellipsis_0.3.2
[45] xml2_1.3.2 reprex_2.0.0 assertthat_0.2.1 httr_1.4.2
[49] rstudioapi_0.13 R6_2.5.0 nlme_3.1-152 compiler_4.1.0

R and RStudio crashes running read_parquet() on Mac M1

As the title states, both R and RStudio crash with a 'fatal error' when I try to run
read_parquet('abc.parquet')
For reference, read_parquet() is a function from the arrow() library
Using:
Macbook Pro M1 2020
Macbook Pro M1 2020
R version 4.1.0 (I think it is running through rosetta, activity monitor says 'Intel')
RStudio 1.4.1717
arrow 4.0.1
R sessionInfo():
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 10.16
Matrix products: default
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] arrow_4.0.1 data.table_1.14.0 dplyr_1.0.7 bsts_0.9.6 xts_0.12.1
[6] zoo_1.8-9 BoomSpikeSlab_1.2.4 Boom_0.9.7 MASS_7.3-54 reshape2_1.4.4
[11] DescTools_0.99.42 lubridate_1.7.10
loaded via a namespace (and not attached):
[1] Rcpp_1.0.6 compiler_4.1.0 pillar_1.6.1 plyr_1.8.6 class_7.3-19 tools_4.1.0
[7] bit_4.0.4 boot_1.3-28 tibble_3.1.2 lifecycle_1.0.0 rootSolve_1.8.2.1 lattice_0.20-44
[13] pkgconfig_2.0.3 rlang_0.4.11 Matrix_1.3-3 DBI_1.1.1 rstudioapi_0.13 mvtnorm_1.1-2
[19] expm_0.999-6 xfun_0.24 e1071_1.7-7 stringr_1.4.0 generics_0.1.0 vctrs_0.3.8
[25] bit64_4.0.5 tidyselect_1.1.1 gld_2.6.2 grid_4.1.0 glue_1.4.2 R6_2.5.0
[31] fansi_0.5.0 lmom_2.8 purrr_0.3.4 magrittr_2.0.1 ellipsis_0.3.2 assertthat_0.2.1
[37] Exact_2.1 utf8_1.2.1 tinytex_0.32 stringi_1.6.2 proxy_0.4-26 crayon_1.4.1
Here is a parquet file (one of many) which I am failing to import:
file.parquet

table does not appear when using the package formattable() in R 4.1.0 or R 4.0.3 version

I'm trying to use formatable() but I'm not successful. I'm using some examples from the official CRAN documentation, but not even the examples are running.
i try version R 4.1.0 and 4.0.3, but dont worked.
my code exemple:
library(formattable)
formattable(mtcars, list(mpg = color_bar("lightgray", proportion)))
when using the command the column information disappears
Update:
SessionInfo()
R version 4.0.5 (2021-03-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 8.1 x64 (build 9600)
Matrix products: default
locale:
[1] LC_COLLATE=Portuguese_Brazil.1252 LC_CTYPE=Portuguese_Brazil.1252
[3] LC_MONETARY=Portuguese_Brazil.1252 LC_NUMERIC=C
[5] LC_TIME=Portuguese_Brazil.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] dplyr_1.0.2 readxl_1.3.1 writexl_1.3.1 webshot_0.5.2
[5] htmltools_0.4.0 formattable_0.2.1
loaded via a namespace (and not attached):
[1] Rcpp_1.0.4.6 cellranger_1.1.0 pillar_1.4.6 compiler_4.0.5
[5] dbplyr_1.4.4 tools_4.0.5 digest_0.6.25 jsonlite_1.6.1
[9] evaluate_0.14 lubridate_1.7.9 lifecycle_0.2.0 tibble_3.0.1
[13] gtable_0.3.0 lattice_0.20-41 pkgconfig_2.0.3 rlang_0.4.7
[17] DBI_1.1.0 cli_2.0.2 rstudioapi_0.11 yaml_2.2.1
[21] xfun_0.14 terra_1.2-10 raster_3.4-5 knitr_1.28
[25] generics_0.0.2 vctrs_0.3.4 htmlwidgets_1.5.1 grid_4.0.5
[29] tidyselect_1.1.0 glue_1.4.1 R6_2.4.1 fansi_0.4.1
[33] rmarkdown_2.2 sp_1.4-2 purrr_0.3.4 ggplot2_3.3.2
[37] blob_1.2.1 magrittr_1.5 scales_1.1.1 codetools_0.2-18
[41] ellipsis_0.3.1 assertthat_0.2.1 colorspace_1.4-1 munsell_0.5.0
[45] crayon_1.3.4
formattable_0.2.1
Can you provide sessionInfo(), please? I tried to run the code, and it works fine for me.
This is my sessionInfo():
R version 4.1.0 (2021-05-18)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Pop!_OS 20.04 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.9.0
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.9.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_DK.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_DK.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_DK.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_DK.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] formattable_0.2.1 forcats_0.5.1 stringr_1.4.0 dplyr_1.0.6 purrr_0.3.4 readr_1.4.0 tidyr_1.1.3
[8] tibble_3.1.2 ggplot2_3.3.3 tidyverse_1.3.1
loaded via a namespace (and not attached):
[1] tidyselect_1.1.1 xfun_0.23 bslib_0.2.4 haven_2.4.1 colorspace_2.0-1 vctrs_0.3.8 generics_0.1.0
[8] htmltools_0.5.1.1 yaml_2.2.1 utf8_1.2.1 rlang_0.4.11 jquerylib_0.1.4 pillar_1.6.1 glue_1.4.2
[15] withr_2.4.2 DBI_1.1.1 dbplyr_2.1.1 modelr_0.1.8 readxl_1.3.1 lifecycle_1.0.0 munsell_0.5.0
[22] gtable_0.3.0 cellranger_1.1.0 rvest_1.0.0 htmlwidgets_1.5.3 evaluate_0.14 knitr_1.33 fansi_0.4.2
[29] broom_0.7.6 Rcpp_1.0.6 scales_1.1.1 backports_1.2.1 jsonlite_1.7.2 fs_1.5.0 hms_1.1.0
[36] digest_0.6.27 stringi_1.6.2 grid_4.1.0 cli_2.5.0 tools_4.1.0 sass_0.3.1 magrittr_2.0.1
[43] crayon_1.4.1 pkgconfig_2.0.3 ellipsis_0.3.2 xml2_1.3.2 reprex_2.0.0 lubridate_1.7.10 assertthat_0.2.1
[50] rmarkdown_2.8 httr_1.4.2 rstudioapi_0.13 R6_2.5.0 compiler_4.1.0
What version of formattable_0.2.1 and R Studio are you using?
Edit 1: It appears that the font is white. Can you try to edit the color of cyl, and see what happens?
formattable(mtcars, list(mpg = color_bar("lightgray", proportion), cyl = color_text("blue", "blue")))
Edit 2: You are using an outdated R Studio version, however, the problem is related to the themes. If you are using custom themes, make sure that these does not set the font in the viewer pane as white.

Resources