Unable to create an R Markdown file in rstudio - r

I am using Rstudio 2022.02.0+433, with r 3.6.2. When trying to create a new rmarkdown file or knit an existing one rstudio asks me to install an updated version of 'yaml' however after I've done this and restarted r the issue still persists.

Related

R Notebook with dlookr package

I try to create Data summary with dlookr package. In normal R it works but in R notebook it has a notification like this:
Error: pandoc document conversion failed with error 251
Anybody knows why?
Pandoc is a program that R Studio relies on to create html files. You may be required to download (https://github.com/jgm/pandoc/releases/tag/2.4) and install (instructions here: https://pandoc.org/installing.html) the pandoc program on your computer. I would also recommend downloading and install MiKTeX (mentioned on the pandoc install page mentioned above; see here: https://miktex.org/) which will allow you to create pdf files.

How does Anaconda work with installing packages?

I just downloaded anaconda and downloaded their basic R package.
I also got some packages from anaconda, using the anaconda terminal commands that they provide on their website.
My question is -- when I am starting a new R session in r studio, do I still need to install.packages()? Can I just load the package?
When I press libary(rJava) for example -- the R command line doesn't say anything back on whether it was successful, that's why I'm not sure. Thanks.
if you have installed the R packages via the R command line then you can just directly load them. I would recommend that you use the command line rather than R studio.

Empty "Rplot.pdf" file is created every time Rstudio is started

I'm using Rstudio 1.1.383 and R version 3.4.2 (2017-09-28) on two different Mac OS X machines.
Every time I start Rstudio or I restart the R session from within Rstudio, an empty file named Rplot.pdf is created in the top folder of the current Rstudio project.
I tried re-installing both Rstudio and R with no avail.
What is causing the issue is the effects package (version 4.0.0). If there is a .R file with the line library(effects) in the project folder and I open the project, or if I open an .Rmd file containing that line from within Rstudio, the plot is created (to be sure, the issue is not happening when loading the package).
I downgraded to a previous version and that seems to have solved the problem.

Command line equivalent to "Run Document" for R versions >= 3.2.2 so that markdown files can access the global environment

I am making an interactive R Markdown report, with Shiny providing the interactivity. I am having a problem where I cannot access variables in the global environment when I click "Run Document" in RStudio (as described here). That same sections describes how you can use rmarkdown::run(...) to run the document from the command line, and this question shows that this allows the report to access variables in the global environment.
However, for my version of R I get the following error in the pop up window:
Error: pandoc version 1.12.3 or higher is required and was not found.
When I try and install pandoc, I get:
> install.packages("pandoc")
Warning in install.packages :
package ‘pandoc’ is not available (for R version 3.2.2)
Is there a fix for this?
pandoc isn't a R package. It's something you need installed on your system. RStudio provides it if you don't have it installed. Updating RStudio should fix the issue if you don't want to install pandoc manually.

Knitting error when knitting html on RStudio

I've been a regular R user for 1.5 years. Never seen this happen and have no idea how to fix it. I've read the whole Internet in search of a solution without luck. I have tried restarting my computer and reinstalling RStudio. I am able to knit any .Rmd as a .pdf or .html the first time I try it, but subsequent tries fail with the error messages below. This happens with both tried-and-true .Rmd that have worked previously as well as new template .Rmd files created through RStudio's File-->New option. If I re-install RStudio, it allows knitting of any .Rmd file again on the first try.
Loading required package: knitr
Warning message:
package ‘knitr’ was built under R version 3.2.3
processing file: HW16.Rmd
|.................................................................| 100%
ordinary text without R code
output file: HW16.md
[1] "HW16.md"
Error generating HTML preview for ~/Dropbox/MyProjects/spring2016/advancedMachineLearning/HW16.Rmd r error 4 (R code execution error)
The console generates:
I found a solution: delete R from your computer. You do not need to re-install RStudio. To delete R on my Mac, I went to /Library/Frameworks/R.framework/Versions/ then deleted the folders "3.2.x" (these stand for the version of R. It is possible that you have more than one version installed). Next, I re-installed R using brew in the terminal.
brew tap homebrew/science
brew install r
Open RStudio. Knit any .Rmd that is known to work, or a fresh .Rmd generated by RStudio. Knit again. Problem solved!

Resources