R session is aborted when I assign one matrix to another - r

I just got a new Acer Swift laptop and installed ubuntu 20.04 on it. I installed R.4.0.3 and Rstudio 1.2.5042
I tried to run a script that is running without problems on my old computer. R crashes and Rstudio aborts when I assign one matrix to another. I tried increasing R memory (it is inf now) and doing the same assignment using matrix subsets. It still crashes. R session is also aborted if I skip the matrix assignment and just try to do other manipulations with the matrix ext_data.df
FYI: data.input is a matrix 33538 x 11366. ext_data.df is properly initialiozed. It is only at the assignment
ext_data.df[common_genes,] = data.input[common_genes,]
that the crash happens.
ext_data.df=matrix(0,dim(gene_list)[1],dim(data.input)[2])
rownames(ext_data.df) = gene_list$X2
colnames(ext_data.df) <- colnames(data.input)
common_genes = intersect(gene_list$X2,rownames(data.input))
ext_data.df[common_genes,] = data.input[common_genes,]
sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.1 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas-serial/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-serial/liblapack.so.3
locale:
[1] LC_CTYPE=en_SG.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_SG.UTF-8 LC_COLLATE=en_SG.UTF-8
[5] LC_MONETARY=en_SG.UTF-8 LC_MESSAGES=en_SG.UTF-8
[7] LC_PAPER=en_SG.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_SG.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] tensorflow_2.2.0 kknn_1.3.1 plotly_4.9.3 viridis_0.5.1
[5] viridisLite_0.3.0 KernelKnn_1.1.0 forcats_0.5.0 stringr_1.4.0
[9] dplyr_1.0.3 purrr_0.3.4 readr_1.4.0 tidyr_1.1.2
[13] tibble_3.0.5 tidyverse_1.3.0 keras_2.3.0.0 ggpubr_0.4.0
[17] ggplot2_3.3.3 ggsci_2.9 class_7.3-17 Seurat_3.2.3
loaded via a namespace (and not attached):
[1] readxl_1.3.1 backports_1.2.1 plyr_1.8.6
[4] igraph_1.2.6 lazyeval_0.2.2 splines_4.0.3
[7] listenv_0.8.0 scattermore_0.7 tfruns_1.4
[10] digest_0.6.27 htmltools_0.5.1.1 fansi_0.4.2
[13] magrittr_2.0.1 tensor_1.5 cluster_2.1.0
[16] ROCR_1.0-11 openxlsx_4.2.3 globals_0.14.0
[19] modelr_0.1.8 matrixStats_0.57.0 askpass_1.1
[22] colorspace_2.0-0 rvest_0.3.6 rappdirs_0.3.1
[25] ggrepel_0.9.1 haven_2.3.1 crayon_1.3.4
[28] jsonlite_1.7.2 spatstat_1.64-1 spatstat.data_1.7-0
[31] zeallot_0.1.0 survival_3.2-7 zoo_1.8-8
[34] glue_1.4.2 polyclip_1.10-0 gtable_0.3.0
[37] leiden_0.3.7 car_3.0-10 future.apply_1.7.0
[40] abind_1.4-5 scales_1.1.1 DBI_1.1.1
[43] rstatix_0.6.0 miniUI_0.1.1.1 Rcpp_1.0.6
[46] xtable_1.8-4 reticulate_1.18 foreign_0.8-81
[49] rsvd_1.0.3 umap_0.2.7.0 htmlwidgets_1.5.3
[52] httr_1.4.2 RColorBrewer_1.1-2 ellipsis_0.3.1
[55] ica_1.0-2 pkgconfig_2.0.3 uwot_0.1.10
[58] dbplyr_2.0.0 deldir_0.2-9 tidyselect_1.1.0
[61] rlang_0.4.10 reshape2_1.4.4 later_1.1.0.1
[64] munsell_0.5.0 cellranger_1.1.0 tools_4.0.3
[67] cli_2.2.0 generics_0.1.0 broom_0.7.3
[70] ggridges_0.5.3 fastmap_1.1.0 goftest_1.2-2
[73] fs_1.5.0 fitdistrplus_1.1-3 zip_2.1.1
[76] RANN_2.6.1 pbapply_1.4-3 future_1.21.0
[79] nlme_3.1-151 whisker_0.4 mime_0.9
[82] xml2_1.3.2 compiler_4.0.3 rstudioapi_0.13
[85] curl_4.3 png_0.1-7 ggsignif_0.6.0
[88] spatstat.utils_2.0-0 reprex_0.3.0 stringi_1.5.3
[91] RSpectra_0.16-0 lattice_0.20-41 Matrix_1.3-2
[94] vctrs_0.3.6 pillar_1.4.7 lifecycle_0.2.0
[97] lmtest_0.9-38 RcppAnnoy_0.0.18 data.table_1.13.6
[100] cowplot_1.1.1 irlba_2.3.3 httpuv_1.5.5
[103] patchwork_1.1.1 R6_2.5.0 promises_1.1.1
[106] KernSmooth_2.23-18 gridExtra_2.3 rio_0.5.16
[109] parallelly_1.23.0 codetools_0.2-18 MASS_7.3-53
[112] assertthat_0.2.1 openssl_1.4.3 withr_2.4.0
[115] sctransform_0.3.2 mgcv_1.8-33 parallel_4.0.3
[118] hms_1.0.0 grid_4.0.3 rpart_4.1-15
[121] carData_3.0-4 Rtsne_0.15 shiny_1.6.0
[124] lubridate_1.7.9.2 base64enc_0.1-3
Could you please help me solve the problem?
Thank you very much!

Could it be that you are using 32 bit version of R?
32 bit applications can only access a maximum of 4 Gigs of memory.
Can you try the following
.Machine$sizeof.pointer
it should return 8 if you are using 64 bit R

Update: It is clearly a memory problem. When I try to do the assignment
ext_data.df[common_genes,1:1000]=data.input[common_genes, 1:1000] it works.
I monitored the usage with mem_used() and found that it works up to 7.8GB (it happens for ext_data.df[common_genes,1:3000]=data.input[common_genes, 1:3000].
At 8GB, the R session gets aborted. How can I increase the memory above 8GB. In my old laptop (MacBook Pro), the mem_used was 8.21GB for the whole assignment.
I have to note that I use Sys.setenv('R_MAX_MEM_SIZE'=64000000000)
and Sys.setenv('R_MAX_VSIZE'=64000000000) in the beginning of my script.

Maybe you can try increasing the memory via memory.limit().
You can refer to this stackoverflow thread for more information:
Increasing (or decreasing) the memory available to R processes

Related

Update atributte table columns contents (character type) from other joined csv table (r software)

I've tried merge and update columns values with this code.
For now the joined fields are correct. (#1)
Now I want update the fields of column.x with values in column.y.
I'm using the second part (#2) but without success.
#1 - code to merge table 'parcelas_sql' with 'tbd_con_sig' by 'codigo'
join_sig_csv <- merge(parcelas_sql, tbd_cons_sig, by.x = "codigo", by.y = "codigo", duplicateGeoms=TRUE)
#2 - update field 'n.cont.x' with 'n.cont.y' values
join_sig_csv[join_sig_csv$n.cont.x == n.cont.x] <- n.cont.y
error_message:
Error in h(simpleError(msg, call)) :
error in evaluating the argument 'i' in selecting a method for function '[<-': object 'n.cont.x' not found
-------------------------------------- sessionInfo() -----------------
version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
Matrix products: default
locale:
[1] LC_COLLATE=Portuguese_Portugal.1252 LC_CTYPE=Portuguese_Portugal.1252 LC_MONETARY=Portuguese_Portugal.1252 LC_NUMERIC=C
[5] LC_TIME=Portuguese_Portugal.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RODBC_1.3-19 maptools_1.1-4 sf_1.0-7 terra_1.5-21 spData_2.0.1 rgdal_1.5-32 rgeos_0.5-9 sp_1.4-6 rvest_1.0.2 showtext_0.9-5
[11] showtextdb_3.0 sysfonts_0.8.8 classInt_0.4-3 tmap_3.3-3 lubridate_1.8.0 fs_1.5.2 forcats_0.5.1 stringr_1.4.0 dplyr_1.0.7 purrr_0.3.4
[21] readr_2.1.1 tidyr_1.1.4 tibble_3.1.6 ggplot2_3.3.5 tidyverse_1.3.1
loaded via a namespace (and not attached):
[1] RColorBrewer_1.1-2 httr_1.4.2 tools_4.1.2 backports_1.4.1 utf8_1.2.2 R6_2.5.1
[7] KernSmooth_2.23-20 DBI_1.1.2 colorspace_2.0-2 raster_3.5-15 withr_2.4.3 tidyselect_1.1.1
[13] leaflet_2.1.1 compiler_4.1.2 leafem_0.2.0 cli_3.1.0 xml2_1.3.3 scales_1.1.1
[19] proxy_0.4-26 digest_0.6.29 foreign_0.8-81 base64enc_0.1-3 dichromat_2.0-0.1 pkgconfig_2.0.3
[25] htmltools_0.5.2 dbplyr_2.1.1 fastmap_1.1.0 htmlwidgets_1.5.4 rlang_0.4.12 readxl_1.3.1
[31] rstudioapi_0.13 generics_0.1.1 jsonlite_1.7.2 crosstalk_1.2.0 magrittr_2.0.1 Rcpp_1.0.7
[37] munsell_0.5.0 fansi_0.5.0 abind_1.4-5 lifecycle_1.0.1 stringi_1.7.6 leafsync_0.1.0
[43] tmaptools_3.1-1 grid_4.1.2 parallel_4.1.2 crayon_1.4.2 lattice_0.20-45 stars_0.5-5
[49] haven_2.4.3 hms_1.1.1 pillar_1.6.4 codetools_0.2-18 reprex_2.0.1 XML_3.99-0.8
[55] glue_1.6.0 leaflet.providers_1.9.0 modelr_0.1.8 png_0.1-7 vctrs_0.3.8 tzdb_0.2.0
[61] cellranger_1.1.0 gtable_0.3.0 assertthat_0.2.1 lwgeom_0.2-8 broom_0.7.11 e1071_1.7-9
[67] class_7.3-19 viridisLite_0.4.0 units_0.8-0 ellipsis_0.3.2

ShinyApp accents and special characters problems

I would like to know how I can solve the problem of accents and special characters, I don't know why special characters (´,ñ, etc) appear wrong, with the code I don't have any problem but when running the shiny app all the labels where this type of characters are appear as an attachment in the image below. I have read about saving with utf-8 encoding but the problem is still not fixed, below I share information about my session.
wrong labels: Número, Gráfico, Comunicación
R version 3.6.3 (2020-02-29)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)
Matrix products: default
locale:
[1] LC_COLLATE=Spanish_Spain.1252 LC_CTYPE=Spanish_Spain.1252
[3] LC_MONETARY=Spanish_Spain.1252 LC_NUMERIC=C
[5] LC_TIME=Spanish_Spain.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base
other attached packages:
[1] stringi_1.6.1 plotly_4.10.0 ggplot2_3.3.5
[4] dplyr_1.0.7 shinyFiles_0.9.1 visNetwork_2.1.0
[7] openxlsx_4.2.4 shinyalert_2.0.0 lubridate_1.7.10
[10] data.table_1.14.2 DT_0.20 shinyjs_2.0.0
[13] shiny_1.7.1
loaded via a namespace (and not attached):
[1] Rcpp_1.0.6 lattice_0.20-38 tidyr_1.1.4
[4] assertthat_0.2.1 digest_0.6.27 utf8_1.2.1
[7] mime_0.10 R6_2.5.1 evaluate_0.14
[10] httr_1.4.2 pillar_1.6.4 rlang_0.4.11
[13] uuid_0.1-4 lazyeval_0.2.2 fontawesome_0.2.2
[16] rstudioapi_0.13 jquerylib_0.1.4 rmarkdown_2.11
[19] foreign_0.8-75 htmlwidgets_1.5.4 munsell_0.5.0
[22] compiler_3.6.3 httpuv_1.6.1 xfun_0.30
[25] pkgconfig_2.0.3 htmltools_0.5.2 tidyselect_1.1.1
[28] tibble_3.1.1 fansi_0.4.2 viridisLite_0.4.0
[31] crayon_1.4.2 withr_2.4.2 later_1.2.0
[34] grid_3.6.3 jsonlite_1.7.2 xtable_1.8-4
[37] gtable_0.3.0 lifecycle_1.0.1 DBI_1.1.2
[40] magrittr_2.0.1 scales_1.1.1 zip_2.2.0
[43] cli_3.1.0 cachem_1.0.4 fs_1.5.0
[46] promises_1.2.0.1 sp_1.4-6 bslib_0.3.1
[49] ellipsis_0.3.2 generics_0.1.1 vctrs_0.3.8
[52] tools_3.6.3 glue_1.4.2 purrr_0.3.4
[55] crosstalk_1.1.1 rsconnect_0.8.25 fastmap_1.1.0
[58] yaml_2.2.1 colorspace_2.0-1 maptools_1.1-2
[61] knitr_1.36 sass_0.4.0

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

Error: All list elements must be lists themselves: Error in using spread_draws function in tidybayes

In playing around with the tidybayes package (I replicated the data from the code simulated in the vignette: http://mjskay.github.io/tidybayes/articles/tidybayes.html), I continue to stumble onto the error: Error: All list elements must be lists themselves when using the spread_draws function (or any other functions in the tidybayes, for that matter). Here is the simulated data from the vignette:
library(tidyverse)
library(tidybayes)
library(brms)
set.seed(5)
n = 10
n_condition = 5
ABC =
tibble(
condition = rep(c("A","B","C","D","E"), n),
response = rnorm(n * 5, c(0,1,2,1,-1), 0.5)
)
Here is the code for fitting the model:
m = brm(
response ~ (1|condition),
data = ABC,
prior = c(
prior(normal(0, 1), class = Intercept),
prior(student_t(3, 0, 1), class = sd),
prior(student_t(3, 0, 1), class = sigma)
),
control = list(adapt_delta = .99)
)
But, even in trying to use the get_variables function, I get the same error as mentioned above. Has anyone else had a similar problem or been able to solve this one?
Here is the session info.
> sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.7
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
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/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] tidybayes_3.0.1 see_0.6.7 bayestestR_0.11.0 semTools_0.5-5
[5] lavaan_0.6-9 HDInterval_0.2.2 brms_2.15.0 Rcpp_1.0.6
[9] ggsignif_0.6.2 reshape2_1.4.4 ggsci_2.9 psych_2.0.12
[13] jtools_2.1.3 magrittr_2.0.1 extrafont_0.17 ggthemes_4.2.4
[17] forcats_0.5.1 stringr_1.4.0 dplyr_1.0.4 purrr_0.3.4
[21] tidyr_1.1.2 tibble_3.0.6 tidyverse_1.3.0 gridExtra_2.3
[25] ggpubr_0.4.0 ggplot2_3.3.5 readr_1.4.0
loaded via a namespace (and not attached):
[1] utf8_1.1.4 tidyselect_1.1.0 lme4_1.1-26
[4] htmlwidgets_1.5.3 grid_4.0.3 munsell_0.5.0
[7] codetools_0.2-18 statmod_1.4.35 DT_0.18
[10] miniUI_0.1.1.1 withr_2.4.1 Brobdingnag_1.2-6
[13] colorspace_2.0-0 knitr_1.31 rstudioapi_0.13
[16] stats4_4.0.3 Rttf2pt1_1.3.9 bayesplot_1.8.1
[19] labeling_0.4.2 emmeans_1.5.4 rstan_2.21.2
[22] mnormt_2.0.2 farver_2.0.3 datawizard_0.2.0.1
[25] bridgesampling_1.1-2 coda_0.19-4 vctrs_0.3.6
[28] generics_0.1.0 TH.data_1.0-10 xfun_0.25
[31] R6_2.5.0 markdown_1.1 gamm4_0.2-6
[34] projpred_2.0.2 assertthat_0.2.1 promises_1.2.0.1
[37] scales_1.1.1 multcomp_1.4-16 debugme_1.1.0
[40] gtable_0.3.0 processx_3.5.2 sandwich_3.0-0
[43] rlang_0.4.10 splines_4.0.3 rstatix_0.7.0
[46] extrafontdb_1.0 checkmate_2.0.0 broom_0.7.7
[49] inline_0.3.17 yaml_2.2.1 abind_1.4-5
[52] modelr_0.1.8 threejs_0.3.3 crosstalk_1.1.1
[55] backports_1.2.1 httpuv_1.5.5 rsconnect_0.8.18
[58] tensorA_0.36.2 tools_4.0.3 ellipsis_0.3.1
[61] posterior_1.0.1 ggridges_0.5.3 plyr_1.8.6
[64] base64enc_0.1-3 ps_1.5.0 prettyunits_1.1.1
[67] zoo_1.8-8 haven_2.3.1 fs_1.5.0
[70] data.table_1.14.0 ggdist_3.0.0 openxlsx_4.2.3
[73] colourpicker_1.1.0 reprex_1.0.0 tmvnsim_1.0-2
[76] mvtnorm_1.1-1 matrixStats_0.58.0 hms_1.0.0
[79] shinyjs_2.0.0 mime_0.10 evaluate_0.14
[82] arrayhelpers_1.1-0 xtable_1.8-4 shinystan_2.5.0
[85] rio_0.5.16 readxl_1.3.1 rstantools_2.1.1
[88] compiler_4.0.3 V8_3.4.2 crayon_1.4.1
[91] minqa_1.2.4 StanHeaders_2.21.0-7 htmltools_0.5.1.1
[94] mgcv_1.8-34 later_1.1.0.1 RcppParallel_5.1.4
[97] lubridate_1.7.10 DBI_1.1.1 dbplyr_2.1.0
[100] MASS_7.3-54 boot_1.3-27 Matrix_1.3-2
[103] car_3.0-10 cli_2.5.0 parallel_4.0.3
[106] insight_0.14.4 igraph_1.2.6 pkgconfig_2.0.3
[109] foreign_0.8-81 xml2_1.3.2 svUnit_1.0.6
[112] dygraphs_1.1.1.6 pbivnorm_0.6.0 estimability_1.3
[115] rvest_1.0.0 distributional_0.2.2 callr_3.7.0
[118] digest_0.6.27 rmarkdown_2.10 cellranger_1.1.0
[121] curl_4.3 shiny_1.6.0 gtools_3.8.2
[124] nloptr_1.2.2.2 lifecycle_1.0.0 nlme_3.1-152
[127] jsonlite_1.7.2 carData_3.0-4 fansi_0.4.2
[130] pillar_1.5.0 lattice_0.20-41 loo_2.4.1
[133] fastmap_1.1.0 httr_1.4.2 pkgbuild_1.2.0
[136] survival_3.2-11 glue_1.4.2 xts_0.12.1
[139] zip_2.1.1 shinythemes_1.2.0 pander_0.6.3
[142] stringi_1.5.3
If you need any other information or if I oversaw providing something, please let me know!
Many thanks for your help and all the best.
I just encountered the same problem. It seems to be a bug in the recent version 3.0.1. If you fall back on the previous version, your code should work.
devtools::install_version("tidybayes", version = "3.0.0", repos = "http://cran.us.r-project.org")
I've posted the issue on GitHub: https://github.com/mjskay/tidybayes/issues/289

RStudio Viewer Error: "session/viewhtml...." not found

I recently installed a daily build version of R Studio, 1.4.671. Since that installation, anything that runs in the viewer (e.g. gt or lavaanPlot) gives me an error like this:
/session/viewhtml528813ce72d/index.html?viewer_pane=1&capabilities=1&host=http%3A%2F%2F127.0.0.1%3A27742 not found
I have fully uninstalled 1.4.671, restarted my computer, and reinstalled the version that worked this morning, 1.3.1056. Not sure
This is becoming quite a problem because I am not able to easily see any model coefficients that I am currently working on (in a neat way, they are messy in the console).
I have also reset RStudio's state following https://support.rstudio.com/hc/en-us/articles/200534577-Resetting-RStudio-s-State and removed my .Renviron file.
Update: if the error shows but I choose to export as HTML, the HTML file works.
Update2: both running Shiny and knitting an RMarkdown document to HTML works. It's just displaying something inside RStudio's viewer that is causing issues.
R version 4.0.0 (2020-04-24)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base
other attached packages:
[1] gt_0.2.1 patchwork_1.0.0 waffle_1.0.1
[4] plotly_4.9.2.1 ggstance_0.3.4 ggridges_0.5.2
[7] foreign_0.8-78 gghighlight_0.3.0 gridExtra_2.3
[10] readxl_1.3.1 emmeans_1.4.7 broom_0.5.6
[13] fastDummies_1.6.1 modelsummary_0.5.0 tables_0.9.3
[16] gtsummary_1.3.2 janitor_2.0.1 haven_2.3.1
[19] forcats_0.5.0 stringr_1.4.0 dplyr_1.0.0
[22] purrr_0.3.4 readr_1.3.1 tidyr_1.1.0
[25] tibble_3.0.1 ggplot2_3.3.1 tidyverse_1.3.0
loaded via a namespace (and not attached):
[1] nlme_3.1-147 fs_1.4.1 lubridate_1.7.8
[4] RColorBrewer_1.1-2 httr_1.4.1 tools_4.0.0
[7] backports_1.1.7 DT_0.13 R6_2.4.1
[10] DBI_1.1.0 lazyeval_0.2.2 colorspace_1.4-1
[13] withr_2.2.0 tidyselect_1.1.0 extrafontdb_1.0
[16] curl_4.3 compiler_4.0.0 cli_2.0.2
[19] rvest_0.3.5 xml2_1.3.2 sandwich_2.5-1
[22] labeling_0.3 sass_0.2.0 scales_1.1.1
[25] checkmate_2.0.0 mvtnorm_1.1-0 commonmark_1.7
[28] digest_0.6.25 rmarkdown_2.2 pkgconfig_2.0.3
[31] htmltools_0.5.0 extrafont_0.17 dbplyr_1.4.4
[34] htmlwidgets_1.5.1 rlang_0.4.6 rstudioapi_0.11
[37] farver_2.0.3 generics_0.0.2 zoo_1.8-8
[40] jsonlite_1.6.1 magrittr_1.5 Matrix_1.2-18
[43] Rcpp_1.0.4.6 munsell_0.5.0 fansi_0.4.1
[46] lifecycle_0.2.0 stringi_1.4.6 multcomp_1.4-13
[49] yaml_2.2.1 snakecase_0.11.0 MASS_7.3-51.5
[52] plyr_1.8.6 grid_4.0.0 blob_1.2.1
[55] crayon_1.3.4 lattice_0.20-41 splines_4.0.0
[58] hms_0.5.3 knitr_1.28 pillar_1.4.4
[61] estimability_1.3 codetools_0.2-16 reprex_0.3.0
[64] glue_1.4.1 packrat_0.5.0 evaluate_0.14
[67] data.table_1.12.8 modelr_0.1.8 vctrs_0.3.0
[70] Rttf2pt1_1.3.8 cellranger_1.1.0 gtable_0.3.0
[73] assertthat_0.2.1 xfun_0.14 xtable_1.8-4
[76] coda_0.19-3 survival_3.1-12 viridisLite_0.3.0
[79] TH.data_1.0-10 ellipsis_0.3.1
>

Resources