R Studio Convert .RMD to pdf - r

all
Ufff... I believe I did my hw to research this and still don't have an answer so asking all:
I have R-Studio, valid RMD file, when I tried to I don't get new .pdf file, I have viewer which is still html.
No problem to create HTML, it works fine, but I need pdf.
tried to use render ("file.RMD", "file.PDF") to find that I don't have render, tried install pandoc, got an error < package ‘pandoc’ is not available (for R version 3.1.2)>
so what is the simple way to get that pdf, why my doesn't work as desinged? what I'm missing I put that info into header too...
output: pdf_document
Im totaly lost, appreciate help.
render("Proj1.RMD", "Proj1.pdf")
Best
Mario

Related

Link chrome to Rstudio for pagedown (Rmarkdown)

I want to convert my html document, created on Rmarkdown to pdf.
One of the way is to use the pagedown package.
However, when I add:
knit: pagedown::chrome_print
in the yaml header, I get the error:
Error in find_chrome() : Cannot find Google Chrome or Edge automatically from the Windows Registry Hive.
Please pass the full path of chrome.exe or msedge.exe to the 'browser' argument
or to the environment variable 'PAGEDOWN_CHROME'.
However, i have no idea on how to link the Chrome browser to rstudio, or where can I access to 'PAGEDOWN_CHROME'.
I tried:
knit: pagedown::chrome_print(browser="C:/Users/johndoe/AppData/Roaming/Microsoft/Windows/Start Menu/Programs"
which is the path to Chrome but the knitting systematically hangs without giving an error.
I am sure this is an easy procedure but but I'm a beginner at this stuff.
I've done a lot of research on SO and the internet, but obviously everyone knows how to do it !
Thanks :-)

Cant Knit to pdf or html

I'm trying to knit to pdf
I've installed the tinytex and kakble extra packages but it does not knit to any desired format
see the error in the screenshot below
is there something I'm doing wrong or a script or something
Kindly assist me to fix this ... although I'm new to rmd.
check error_per_server_lst, it says that the object does not exists.

Using dsfont package in R Markdown via R Studio

So I can't for the life of me including this dsfont package in R Markdown. I really want to use the double-stroke letters.
I include it in the header like so:
header-includes:
- \usepackage{dsfont}
And I use $\mathds{P}$, for example to denote probability.
The file knit fine with no error but the HTML output is \mathdsP, i.e. it doesn't work.
I tried downloading the dsfont zip directly from CTAN but when I click download nothing happens.
What do I need to do to make this work?
\usepackage is a command for PDF output.
It is not possible to use dsfont with HTML output.

Converting Knitr to PDF

I am trying to convert my knitr to a PDF.
Currently I have been trying the drop down menu in RStudio and selected Knit to PDF.
Error: pandoc version 1.12.3 or higher is required and was not found.
I have downloaded Pandoc here (pandoc-1.15.0.6-windows.msi):
https://github.com/jgm/pandoc/releases
I tried re-running it and the same problem keeps occurring. I am not sure if it is a directory issue or if I am just typing something wrong in but I am having major trouble with this.
Would someone be able to produce a reproducible example in how to type this into R.
Any help would be greatly appreciated and would save me big time. (By the way, I have no trouble with HTML, just PDF)
Thanks!

gvisMotionChart is not working in R markdown file

I need to embed gvisMotionChart into an R markdown file and find an example interactive which is really helpful. However when it comes to the googlevis plotting I keep getting this error when I press the "run code" button:
connection to openCPU failed:
error
undefined
NetworkError: A network error occurred
Can anybody figure out the solutions?
Thanks in advance.
The googleVis package creates the javascript that has to be embedded into an HTML document in order for the interactive plot to run on a webpage. You won't be able to get it to work in the console or in Rstudio for that reason. The only way to know for sure if it's working is to knit it to HTML, and then publish it to Rpubs (or anywhere else online). Once it is online it will work. Depending on your browser settings, you might be able to get it to work by opening the HTML locally, but the browser often blocks the embedded plot when opened locally.
Without seeing your actual code, I can't provide you with anything more specific than that.
EDIT: I thought I would add that several months ago I made a markdown file detailing interactive plots in R for a class. You can find it here: http://rpubs.com/crmhaske/uwloo670_Interactive_Plots
If you scroll down to the very end you'll see the example I did using gvisMotionChart. You have to make sure the place where you print the graph is in it's own chunk, and that results is asis:
```{r results='asis'}
print(p,'chart')
```

Resources