My quarto documents have stopped rendering suddenly. I have reinstalled RStudio and the quarto package, but this issue persists.
When I open a new quarto document, I no longer see the boilerplate material in the new document. The document is empty as if I had selected Create Empty Document, but I haven't.
Then, the document renders when all I include is raw text, but when I include an r code chunk, I get the following message.
Error in xfun::normalize_path(path, ..., must_work = must_work, resolve_symlink = FALSE) :
unused argument (resolve_symlink = FALSE)
Calls: .main ... execute -> setwd -> dirname -> <Anonymous> -> normalize_path
Execution halted
Here is the quarto document I'm attempting to render.
---
title: "Testing"
---
```{r}
mtcars |> print()
```
Here is my session info:
R version 4.2.2 (2022-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 22621)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.utf8
[2] LC_CTYPE=English_United States.utf8
[3] LC_MONETARY=English_United States.utf8
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.utf8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] Rcpp_1.0.9 ps_1.7.2 digest_0.6.30 later_1.3.0
[5] jsonlite_1.8.4 pacman_0.5.1 evaluate_0.20 zip_2.2.2
[9] rlang_1.0.6 cli_3.4.1 rstudioapi_0.14 fs_1.5.2
[13] rmarkdown_2.20 tools_4.2.2 yaml_2.3.6 xfun_0.35
[17] fastmap_1.1.0 parallel_4.2.2 compiler_4.2.2 processx_3.8.0
[21] htmltools_0.5.4 knitr_1.41 quarto_1.2
I was having the exact same issue with knitr, this worked for me:
Remove the package "xfun" from the packages section, then reinstall it immediately after.
I'd tried changing the root install for R and everything. Turns out it was just xfun being weird.
Found the solution on the Posit Community forum.
Do you have any spaces in the filename or file path? That was preventing me from rendering for a bit.
Related
I have installed shiny on R and when I try to run the "default" shiny app generated in RStudio (the Old Faithful Geyser app), nothing happens. Everything just appears to hang (no "listening" message, nothing). I can wait a long time, but nothing ever happens - not even the stop button in RStudio works.
I tried running the app from R directly but there is the same problem, so it does not appear related to RStudio.
I have also tried other apps that I have written but again it is the same problem.
Any ideas? Sorry, this is really vague, but it is hard to be more precise when there is no error, nothing at all.
Here is the sessionInfo().
Thank you!
Rory
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_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:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] shiny_1.6.0
loaded via a namespace (and not attached):
[1] compiler_4.1.0 fastmap_1.1.0 ellipsis_0.3.2 magrittr_2.0.1 R6_2.5.0 promises_1.2.0.1 later_1.2.0
[8] htmltools_0.5.1.1 tools_4.1.0 Rcpp_1.0.6 digest_0.6.27 xtable_1.8-4 httpuv_1.6.1 lifecycle_1.0.0
[15] mime_0.11 rlang_0.4.11
I solved the problem by removing all packages and reinstalling R and R Studio (to the same versions, but anyway). This worked. I have no idea how, but at least it is a working solution.
Thanks to all who gave it some thought!
I had the same issue occur (same R version of 4.1.0 and RStudio 1.4.1717). I didn't have to quite uninstall/reinstall my setup, but a simple update.packages(ask = F) did the trick for me.
I have successfully used save_kable() from kableExtra to export latex tables into *.png before. However, after updating R to the version 4.0.2, save_kable always ends with R fatal error (no specific error message is shown, the session is just aborted). I installed a clean version o R 3.6.3 and everything works fine again.
Next, I re-installed MikTEX, but this does not seem to be the problem because R Markdown can knit a .pdf file without an issue (in the 4.0.2 version). Also, using save_kable with "html" options works fine and exports the table into .png. The problem seems to be specific for latex.
Looking at sessionInfo(), the only difference is that R 3.6.3 automatically loads the 'magick' package, while R 4.0.2 does not. However, loading the magick package manually in the latter R version does not solve the problem. Then, of course, the sessions differ in the "compiler" package versions. Maybe this is the source of the problem?
Any help would be much appreciated. The problem can be reproduced with minimal code such as
kable(mtcars, "latex") %>% save_kable("test.png")
Here is the sessionInfo
R version 4.0.2 (2020-06-22)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041)
Matrix products: default
Random number generation:
RNG: Mersenne-Twister
Normal: Inversion
Sample: Rounding
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] 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] magick_2.4.0 kableExtra_1.1.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.5 rstudioapi_0.11 knitr_1.29 xml2_1.3.2 magrittr_1.5
[6] hms_0.5.3 rvest_0.3.5 munsell_0.5.0 viridisLite_0.3.0 colorspace_1.4-1
[11] R6_2.4.1 rlang_0.4.7 stringr_1.4.0 httr_1.4.1 tools_4.0.2
[16] webshot_0.5.2 xfun_0.15 htmltools_0.5.0 ellipsis_0.3.1 digest_0.6.25
[21] tibble_3.0.3 lifecycle_0.2.0 crayon_1.3.4 readr_1.3.1 vctrs_0.3.2
[26] glue_1.4.1 evaluate_0.14 rmarkdown_2.3 stringi_1.4.6 compiler_4.0.2
[31] pillar_1.4.6 scales_1.1.1 pkgconfig_2.0.3
This seems to be a windows specific problem. I actually just asked a recent question here
kableExtra HTML styling in Rmarkdown and kable_save()
Some of the things I have seen mentioned as potential fixes are listed there such as updating ghostscript, not using tinytext, updating some latex packages including 'standalone', and editing the policy.xls document in ImageMagick ImageMagick security policy 'PDF' blocking conversion.
None of these worked for me and I get the same crashing issues the second I try to kable_save a latex format into png. However, some other Windows users have found success with the steps above so maybe try that out and see how it goes.
I am trying to use this tutorial https://github.com/wvictor14/planet#infer-ethnicity and get the following error message, even when using the test data provided:
pl_infer_ethnicity(pl_betas)
[1] "1860 of 1860 predictors present."
Loading required package: Matrix
Error: 'glmnet_softmax' is not an exported object from 'namespace:glmnet'
I've tried re-installing individual packages and running in a new version or R and get the same error. I believe this is related to other errors posted with a recent update in glmnet. Any tips on how to resolve?
sessionInfo()
R version 3.6.2 (2019-12-12)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)
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 base
other attached packages:
[1] Matrix_1.2-18 planet_0.1.0
loaded via a namespace (and not attached):
[1] lattice_0.20-38 codetools_0.2-16 glmnet_3.0-2 foreach_1.4.7
[5] crayon_1.3.4 grid_3.6.2 magrittr_1.5 pillar_1.4.2
[9] rlang_0.4.2 remotes_2.1.0 iterators_1.0.12 tools_3.6.2
[13] compiler_3.6.2 pkgconfig_2.0.3 shape_1.4.4 tibble_2.1.3
I don't know why it would have worked in the first place; the NEWS file for glmnet doesn't say anything one way or the other about glmnet_softmax (e.g., it does not say "glmnet_softmax is no longer exported" or anything like that ...)
In any case, this is a non-exported function from the glmnet package. It is referred to here in the tutorial code.
If you can change that line of code to refer to glmnet:::glmnet_softmax (i.e., three colons rather than two), that should suffice (::: allows you to access a non-exported function).
I am trying to knit a flexdashboard to an html file. My flexdashboard includes leaflet maps. The knit.md file compiles correctly. At the last stage, converting the knit.md to an html file, I get an error. Apparently leaflet is looking for html dependencies in the R 3.3.2 folder, rather than the R 3.4.2 folder. I originally built this flexdashboard months ago on a different machine on which I had R 3.3.2 (although I was using 3.4.1 I believe to build this). So the problem appears to be that leaflet still looks in the old R-3.3.2 folder for its dependencies even though I've updated and reinstalled leaflet multiple times, trying to fix this problem.
Does anyone know how to tell leaflet to look in the correct place for its html dependencies?
output file: myflexdashboard.knit.md
Error: path for html_dependency not found: C:/R/R-3.3.2/library/leaflet/htmlwidgets/lib/leaflet-providers
> sessionInfo()
R version 3.4.2 (2017-09-28)
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
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.4.2 backports_1.1.1 magrittr_1.5 rprojroot_1.2 htmltools_0.3.6
[6] tools_3.4.2 flexdashboard_0.5.1 yaml_2.1.15 Rcpp_0.12.14 stringi_1.1.6
[11] rmarkdown_1.8 knitr_1.17 jsonlite_1.5 stringr_1.2.0 digest_0.6.12
[16] packrat_0.4.8-1 evaluate_0.10.1
I have a functioning Shiny interactive document (.Rmd) file that works fine locally and on shinyapps.io. I am trying to prerender it using instructions here (http://rmarkdown.rstudio.com/authoring_shiny_prerendered.html) but am running into an unusual error when I introduce a selectInput().
The error message I am getting is the following:
Here's a mininal code block that produces the error.
(app.Rmd)
---
title: 'a title'
output: html_document
runtime: shiny_prerendered
---
```{r, context = 'setup', include=FALSE}
library(shiny)
```
```{r, context='render'}
selectInput('hello','Hi',choices=c('1','2'))
```
```{r, context='server'}
```
Here is my sessionInfo():
R version 3.2.2 (2015-08-14)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1
locale:
[1] 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:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] shiny_1.0.0
loaded via a namespace (and not attached):
[1] Rcpp_0.12.6 digest_0.6.10 rprojroot_1.1 mime_0.5 R6_2.1.2 xtable_1.8-2 backports_1.0.3
[8] magrittr_1.5 evaluate_0.10 stringi_1.1.1 rmarkdown_1.3 tools_3.2.2 stringr_1.1.0 httpuv_1.3.3
[15] yaml_2.1.13 htmltools_0.3.5 knitr_1.15.1
I've tried changing the encoding of my Rmd to UTF-8 with no luck. Changing the runtime to "shiny" (from "shiny_prerendered") seems to fix the problem. Is this a bug in the "shiny_prerendered" runtime or am I doing something wrong?