Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to knit to html or pdf using rmarkdown knit button #1621

Closed
innocenter opened this issue Aug 14, 2019 · 10 comments

Comments

@innocenter
Copy link

commented Aug 14, 2019

I have uninstalled and reinstalled R+Rstudio but still getting the below error when knitting an Rmd file. I have tried most suggestions provided such as including self_contained: no and even installed tinytex : tinytex::install_tinytex()

Below is the Rmarkdown error using the default R markdown example that plots from the car data

==> rmarkdown::render('trial.Rmd', encoding = 'UTF-8');
Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
Execution halted

sessionInfo()
R version 3.6.1 (2019-07-05)
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
[6] methods base

other attached packages:
[1] tinytex_0.15

loaded via a namespace (and not attached):
[1] compiler_3.6.1 htmltools_0.3.6 tools_3.6.1
[4] yaml_2.2.0 Rcpp_1.0.2 rmarkdown_1.14
[7] knitr_1.24 xfun_0.8 digest_0.6.20
[10] evaluate_0.14

tinytex::tinytex_root()
[1] "C:\Users\Innocenter\AppData\Roaming\TinyTeX"

xfun::session_info('rmarkdown')
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134), RStudio 1.2.1335

Locale:
LC_COLLATE=English_United States.1252
LC_CTYPE=English_United States.1252
LC_MONETARY=English_United States.1252
LC_NUMERIC=C
LC_TIME=English_United States.1252

Package version:
base64enc_0.1.3 digest_0.6.20 evaluate_0.14
glue_1.3.1 graphics_3.6.1 grDevices_3.6.1
highr_0.8 htmltools_0.3.6 jsonlite_1.6
knitr_1.24 magrittr_1.5 markdown_1.1
methods_3.6.1 mime_0.7 Rcpp_1.0.2
rmarkdown_1.14 stats_3.6.1 stringi_1.4.3
stringr_1.4.0 tinytex_0.15 tools_3.6.1
utils_3.6.1 xfun_0.8 yaml_2.2.0

Pandoc version: 2.6

What am not understanding is if I use
rmarkdown::render("trial.Rmd") then I get the desired output - however this is not the best solution since am interested in creating posts using blogdown and this solution does not work when I use blogdown ::serve_site()

Kindly assist
Same issue has been posted on Rstudio


By filing an issue to this repo, I promise that

  • I have fully read the issue guide at https://yihui.name/issue/.
  • I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('rmarkdown'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('rstudio/rmarkdown').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

@yihui

This comment has been minimized.

Copy link
Member

commented Aug 14, 2019

Please read the last part of your issue and provide a minimal reproducible example. Thanks!

@innocenter

This comment has been minimized.

Copy link
Author

commented Aug 15, 2019

Hi @yihui
Below is the featured reproducible example


 ---

title: "trial"

author: "Iam"

output: html_document

--- 

```{r setup, include=FALSE}

knitr::opts_chunk$set(echo = TRUE)

```

## R Markdown



```{r cars}

summary(cars)

```

## Including Plots

You can also embed plots, for example:

```{r pressure, echo=FALSE}

plot(pressure)

``` 

@cderv

This comment has been minimized.

Copy link
Contributor

commented Aug 15, 2019

Hi @innocenter ,

Thank you for the reproducible example.
Please, can you format it correctly following guidelines: https://yihui.name/issue/#please-format-your-issue-correctly
You'll need one some backticks arount the code parts, and one more backtick than the chunk. It explained in the post I linked.

This will help us copy paste you code in a Rmd for trying to reproduce.
Thanks !

@innocenter

This comment has been minimized.

Copy link
Author

commented Aug 16, 2019

I have edited the reproducible example @cderv

@cderv

This comment has been minimized.

Copy link
Contributor

commented Aug 16, 2019

Thanks for the edition. I can now rerun your example and it works for me using the knit button.

  • I copy paste your rmd code in a new file test.Rmd
  • I saved the file
  • I clicked on the knit button => Works
  • I also tried rmarkdown::render('test.Rmd', encoding = 'UTF-8')

Can you try that in a new session with a new file too ?
Thanks.

@innocenter

This comment has been minimized.

Copy link
Author

commented Aug 16, 2019

Restarting my machine by default I get the following message

R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit) .....

''''
Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
[Workspace loaded from ~/.RData]

I have used unlink("~/.RData") some of the workspaces but still getting the same error after every restart - am not sure which workspace is linked here

sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)

Matrix products: default

Random number generation:
RNG: Mersenne-Twister
Normal: Inversion
Sample: Rounding

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
[6] methods base

loaded via a namespace (and not attached):
[1] compiler_3.6.1 tools_3.6.1

Using rmarkdown::render("trial.Rmd") I get the desired output however it does not work with the knit button. This started after updating R version to 3.6.1 am not quiet sure what is causing this.

Thanks for the support so far

@cderv

This comment has been minimized.

Copy link
Contributor

commented Aug 16, 2019

You may be interested to follow the advices from here
https://whattheyforgot.org/save-source.html

To get a blank state and not save your .Rdata.

You need to delete it, clean your workspace and be sure Rdata is not saved at closing.
Follow point 1.3.

Then you’ll have a clean session to try again. This Rdata file could be the source of the issue from your previous post.

@yihui

This comment has been minimized.

Copy link
Member

commented Aug 16, 2019

If .RData is not the culprit, the other possible culprit is .Rprofile (it could exist in multiple places, including your project root, working directory, or home directory normalizePath('~')). In any case, I believe rmarkdown is unlikely to be the culprit.

@innocenter

This comment has been minimized.

Copy link
Author

commented Aug 17, 2019

You may be interested to follow the advices from here
https://whattheyforgot.org/save-source.html

To get a blank state and not save your .Rdata.

You need to delete it, clean your workspace and be sure Rdata is not saved at closing.
Follow point 1.3.

Then you’ll have a clean session to try again. This Rdata file could be the source of the issue from your previous post.

I had done this and was still unsuccessful

@innocenter

This comment has been minimized.

Copy link
Author

commented Aug 17, 2019

If .RData is not the culprit, the other possible culprit is .Rprofile (it could exist in multiple places, including your project root, working directory, or home directory normalizePath('~')). In any case, I believe rmarkdown is unlikely to be the culprit.

yeah the culprint was .Rprofile - it existed in multiple places as you have stated. I've managed to sort it out. Some of the links that helped me figure out https://whattheyforgot.org/r-startup.html and https://csgillespie.github.io/efficientR/3-3-r-startup.html

Now I can knit Rmd files without any error- thanks the guidance.

@innocenter innocenter closed this Aug 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.