When I preview my R Notebook, the HTML output contains strange characters.
This chunk code and output
gets rendered in HTML as
How should I fix this?
SessionInfo:
R version 3.6.0 (2019-04-26)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)
Matrix products: default
locale:
1 LC_COLLATE=Dutch_Netherlands.1252 LC_CTYPE=Dutch_Netherlands.1252 LC_MONETARY=Dutch_Netherlands.1252 LC_NUMERIC=C
[5] LC_TIME=Dutch_Netherlands.1252
other attached packages:
1 plotly_4.9.0 DT_0.6 shinydashboard_0.7.1 shiny_1.3.2 lubridate_1.7.4 forcats_0.4.0
[7] stringr_1.4.0 dplyr_0.8.1 purrr_0.3.2 readr_1.3.1 tidyr_0.8.3 tibble_2.1.1
[13] ggplot2_3.1.1 tidyverse_1.2.1
loaded via a namespace (and not attached):
1 tidyselect_0.2.5 xfun_0.7 haven_2.1.0 lattice_0.20-38 colorspace_1.4-1 generics_0.0.2 viridisLite_0.3.0 htmltools_0.3.6
[9] base64enc_0.1-3 yaml_2.2.0 rlang_0.3.4 pillar_1.4.0 later_0.8.0 glue_1.3.1 withr_2.1.2 modelr_0.1.4
[17] readxl_1.3.1 plyr_1.8.4 munsell_0.5.0 gtable_0.3.0 cellranger_1.1.0 rvest_0.3.4 htmlwidgets_1.3 evaluate_0.14
[25] knitr_1.23 httpuv_1.5.1 crosstalk_1.0.0 broom_0.5.2 Rcpp_1.0.1 xtable_1.8-4 scales_1.0.0 backports_1.1.4
[33] promises_1.0.1 jsonlite_1.6 mime_0.6 hms_0.4.2 digest_0.6.19 stringi_1.4.3 grid_3.6.0 cli_1.1.0
[41] tools_3.6.0 magrittr_1.5 lazyeval_0.2.2 crayon_1.3.4 pkgconfig_2.0.2 data.table_1.12.2 xml2_1.2.0 rmarkdown_1.13
[49] assertthat_0.2.1 httr_1.4.0 rstudioapi_0.10 R6_2.4.0 nlme_3.1-139 compiler_3.6.0
Related
I got error editable from DT package
Error in if (editable) params$editable = editable :
argument is not interpretable as logical
In addition: Warning message:
In if (editable) params$editable = editable :
the condition has length > 1 and only the first element will be used
library(DT)
DT::datatable(head(iris), editable = list(
target = 'row', disable = list(columns = c(1, 3, 4)))
)
This is my R sessionInfo()
> sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux
Matrix products: default
BLAS: /usr/lib64/libblas.so.3.4.2
LAPACK: /usr/lib64/liblapack.so.3.4.2
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] DT_0.5 readr_1.3.1 tidyr_0.8.3 tibble_2.1.1
[5] tidyverse_1.2.1 fs_1.2.7 RColorBrewer_1.1-2 rvg_0.2.0
[9] magrittr_1.5 officer_0.3.3 esquisse_0.3.0.940 scales_1.0.0
[13] colourpicker_1.0 shinyjqui_0.3.2 plotly_4.9.0 ggplot2_3.1.1
[17] forcats_0.4.0 arsenal_3.0.0 waiter_0.0.1 shinydashboardPlus_0.7.0
[21] future_1.12.0 data.table_1.12.2 shinyFiles_0.7.2 stringi_1.4.3
[25] shinyjs_1.0 shinyWidgets_0.4.8 purrr_0.3.2 rintrojs_0.2.0
[29] shinyBS_0.61 shinyalert_1.0 shinydashboard_0.7.1 stringr_1.4.0
[33] lubridate_1.7.4 dplyr_0.8.0.1 haven_2.1.0 shiny_1.3.1
loaded via a namespace (and not attached):
[1] nlme_3.1-137 httr_1.4.0 tools_3.5.3 backports_1.1.4 R6_2.4.0 lazyeval_0.2.2
[7] colorspace_1.4-1 withr_2.1.2 tidyselect_0.2.5 compiler_3.5.3 cli_1.1.0 rvest_0.3.3
[13] xml2_1.2.0 digest_0.6.18 rmarkdown_1.12 base64enc_0.1-3 pkgconfig_2.0.2 htmltools_0.3.6
[19] htmlwidgets_1.3 rlang_0.3.4 readxl_1.3.1 rstudioapi_0.10 generics_0.0.2 jsonlite_1.6
[25] crosstalk_1.0.0 zip_2.0.1 Rcpp_1.0.1 munsell_0.5.0 gdtools_0.1.8 yaml_2.2.0
[31] plyr_1.8.4 grid_3.5.3 parallel_3.5.3 listenv_0.7.0 promises_1.0.1 crayon_1.3.4
[37] miniUI_0.1.1.1 lattice_0.20-38 hms_0.4.2 knitr_1.22 pillar_1.3.1 uuid_0.1-2
[43] codetools_0.2-16 glue_1.3.1 packrat_0.5.0 evaluate_0.13 modelr_0.1.4 httpuv_1.5.1
[49] testthat_2.0.1 cellranger_1.1.0 gtable_0.3.0 assertthat_0.2.1 xfun_0.6 mime_0.6
[55] xtable_1.8-4 broom_0.5.2 later_0.8.0 rsconnect_0.8.13 viridisLite_0.3.0 tinytex_0.12
[61] globals_0.12.4 ellipsis_0.1.0
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
>
Please help.
I was able to run my shiny app when I had R version 3.5.1. The app was working fine. Now, as per the need of the server that we have , I needed to switch my local R version to 3.6.1 and had to reinstall all the packages.
Now, I am using bootsraplib library to get the app in Bootsrap4 version. But , now all those elements which were defined earlier in a conditional panel / they needed to be displayed under certain conditions , they are not getting displayed even when , in the server side the code that needs to run to get the condition to get those elements displayed gets executed correctly. but in UI side, those elements are not getting displayed now.
sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] reshape2_1.4.4 cowplot_1.0.0 bookdown_0.20.1 tinytex_0.24 shinysky_0.1.3 waiter_0.1.2
[7] rhandsontable_0.3.7 rio_0.5.16 shinyEffects_0.1.0 shinymaterial_1.1.0 plotly_4.9.2.1 expss_0.10.5
[13] scales_1.1.1 ggplot2_3.3.2 formattable_0.2.1 shinydashboard_0.7.1 dplyr_1.0.0 lubridate_1.7.9
[19] shinydashboardPlus_0.7.5 shinyWidgets_0.5.3 magrittr_1.5 shinyjs_1.1 shinyBS_0.61 devtools_2.3.0
[25] usethis_1.6.1 kableExtra_1.1.0 knitr_1.29 DT_0.14 shiny_1.5.0.9001
loaded via a namespace (and not attached):
[1] matrixStats_0.56.0 fs_1.4.2 webshot_0.5.2 httr_1.4.2 rprojroot_1.3-2 tools_3.6.1 backports_1.1.8
[8] R6_2.4.1 lazyeval_0.2.2 colorspace_1.4-1 withr_2.2.0 tidyselect_1.1.0 prettyunits_1.1.1 processx_3.4.3
[15] curl_4.3 compiler_3.6.1 cli_2.0.2 rvest_0.3.5 htmlTable_2.0.1 xml2_1.3.2 desc_1.2.0
[22] checkmate_2.0.0 readr_1.3.1 callr_3.4.3 stringr_1.4.0 digest_0.6.25 foreign_0.8-71 rmarkdown_2.3
[29] pkgconfig_2.0.3 htmltools_0.5.0 sessioninfo_1.1.1 fastmap_1.0.1 readxl_1.3.1 htmlwidgets_1.5.1.9001 rlang_0.4.7
[36] rstudioapi_0.11 generics_0.0.2 jsonlite_1.7.0 crosstalk_1.1.0.1 zip_2.0.4 Rcpp_1.0.5 munsell_0.5.0
[43] fansi_0.4.1 lifecycle_0.2.0 stringi_1.4.6 yaml_2.2.1 RJSONIO_1.3-1.4 plyr_1.8.6 pkgbuild_1.1.0
[50] grid_3.6.1 promises_1.1.1 forcats_0.5.0 crayon_1.3.4 haven_2.3.1 hms_0.5.3 ps_1.3.3
[57] pillar_1.4.6 pkgload_1.1.0 glue_1.4.1 evaluate_0.14 data.table_1.12.8 remotes_2.2.0 vctrs_0.3.2
[64] httpuv_1.5.4 cellranger_1.1.0 testthat_2.3.2 gtable_0.3.0 purrr_0.3.4 tidyr_1.1.0 assertthat_0.2.1
[71] xfun_0.15 openxlsx_4.1.5 mime_0.9 xtable_1.8-4 later_1.1.0.1 viridisLite_0.3.0 tibble_3.0.3
[78] memoise_1.1.0 ellipsis_0.3.1
What version of shiny you were using earlier?
Try this - options(shiny.jquery.version = 1)
I'm trying to use the waterfall R package to create a waterfall chart, like this, per the example at this link:
category <- c("Sales", "Services", "Fixed Costs",
"Variable Costs", "Taxes")
amount <- c(101000, 52000, -23000, -15000, -10000)
income <- data.frame(category, amount)
library(ggplot2)
library(waterfalls)
waterfall(income)
But getting this error:
Error in unit(rep(just$hjust, n), "npc") : 'x' and 'units' must have length > 0
How can I make it work?
This is the output from my sessionInfo()
R version 3.6.0 (2019-04-26)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.5
Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/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] waterfalls_0.1.2 DBI_1.0.0 ggpubr_0.2 patchwork_0.0.1 forcats_0.4.0 stringr_1.4.0 dplyr_0.8.0.1 purrr_0.3.2
[10] readr_1.3.1 tidyr_0.8.3 tibble_2.1.1 ggplot2_3.1.1 tidyverse_1.2.1 scales_1.0.0 lubridate_1.7.4 magrittr_1.5 RPresto_1.3.2
[19] knitr_1.22 extrafont_0.17 bigrquery_1.1.1
loaded via a namespace (and not attached):
[1] nlme_3.1-139 sf_0.7-4 bit64_0.9-7 httr_1.4.0 tools_3.6.0 backports_1.1.4 rgdal_1.4-3 R6_2.4.0
[9] KernSmooth_2.23-15 rgeos_0.4-3 lazyeval_0.2.2 colorspace_1.4-1 raster_2.8-19 withr_2.1.2 sp_1.3-1 tidyselect_0.2.5
[17] bit_1.1-14 curl_3.3 compiler_3.6.0 extrafontdb_1.0 cli_1.1.0 rvest_0.3.3 formatR_1.6 xml2_1.2.0
[25] labeling_0.3 dygraphs_1.1.1.6 classInt_0.3-3 digest_0.6.18 foreign_0.8-71 rmarkdown_1.12 base64enc_0.1-3 pkgconfig_2.0.2
[33] htmltools_0.3.6 jsonvalidate_1.0.0 htmlwidgets_1.3 rlang_0.3.4 readxl_1.3.1 rstudioapi_0.10 httpcode_0.2.0 shiny_1.3.2
[41] generics_0.0.2 zoo_1.8-5 jsonlite_1.6 futile.logger_1.4.3 Rcpp_1.0.1 munsell_0.5.0 yaml_2.2.0 stringi_1.4.3
[49] jqr_1.1.0 plyr_1.8.4 grid_3.6.0 settings_0.2.4 maptools_0.9-5 parallel_3.6.0 listenv_0.7.0 promises_1.0.1
[57] crayon_1.3.4 geojsonio_0.7.0 miniUI_0.1.1.1 lattice_0.20-38 haven_2.1.0 geojson_0.3.2 hms_0.4.2 pillar_1.3.1
[65] geojsonlint_0.3.0 codetools_0.2-16 futile.options_1.0.1 crul_0.7.4 glue_1.3.1 infuser_0.2.8 evaluate_0.13 V8_2.2
[73] lambda.r_1.2.3 modelr_0.1.4 png_0.1-7 httpuv_1.5.1 Rttf2pt1_1.3.7 cellranger_1.1.0 gtable_0.3.0 future_1.12.0
[81] RDruid_0.2.3 assertthat_0.2.1 xfun_0.6 mime_0.6 xtable_1.8-4 broom_0.5.2 e1071_1.7-1 later_0.8.0
[89] class_7.3-15 units_0.6-2 globals_0.12.4
I just found that not loading my company's internal package actually fixes this issue. There must be a function in my company's package that's breaking this package.
When I try to render an rmarkdown file with a ggplot image, all the chunks work that do not contain a ggplot image and it fails without an error when it tries to run said chunk.
The output I get in my terminal is
Killed
It runs fine on my local machine with the latest version of R and all the packages updated.
Below is the environment I am using in docker to try to run the same thing (when it fails).
R version 3.4.1 (2017-06-30)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Amazon Linux AMI 2017.09
Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so
locale:
[1] C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] bindrcpp_0.2.2 blogdown_0.10 rmarkdown_1.11 here_0.1
[5] PRROC_1.3.1 DT_0.5 forcats_0.3.0
stringr_1.3.1
[9] dplyr_0.7.8 purrr_0.2.5 readr_1.3.1
tidyr_0.8.2
[13] tibble_2.0.1 ggplot2_3.1.0 tidyverse_1.2.1
data.table_1.12.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.0 lubridate_1.7.4 lattice_0.20-35
assertthat_0.2.0
[5] rprojroot_1.3-2 digest_0.6.18 mime_0.6 R6_2.3.0
[9] cellranger_1.1.0 plyr_1.8.4 backports_1.1.3 evaluate_0.12
[13] httr_1.4.0 pillar_1.3.1 rlang_0.3.1
lazyeval_0.2.1
[17] readxl_1.2.0 rstudioapi_0.9.0 Matrix_1.2-10
reticulate_1.10
[21] htmlwidgets_1.3 munsell_0.5.0 shiny_1.2.0 broom_0.5.1
[25] compiler_3.4.1 httpuv_1.4.5.1 modelr_0.1.2 xfun_0.4
[29] pkgconfig_2.0.2 htmltools_0.3.6 tidyselect_0.2.5 crayon_1.3.4
[33] withr_2.1.2 later_0.7.5 grid_3.4.1 nlme_3.1-131
[37] jsonlite_1.6 xtable_1.8-3 gtable_0.2.0 magrittr_1.5
[41] scales_1.0.0 cli_1.0.1 stringi_1.2.4
promises_1.0.1
[45] xml2_1.2.0 generics_0.0.2 tools_3.4.1 glue_1.3.0
[49] hms_0.4.2 crosstalk_1.0.0 yaml_2.2.0
colorspace_1.4-0
[53] rvest_0.3.2 knitr_1.21 bindr_0.1.1 haven_2.0.0