Remove Hashes in R Output from R Markdown and Knitr

You can include in your chunk options something like comment=NA # to remove all hashes or comment=”%” # to use a different character More help on knitr available from here: http://yihui.name/knitr/options If you are using R Markdown as you mentioned, your chunk could look like this: “`{r comment=NA} summary(cars) “` If you want to change … Read more

pandoc version 1.12.3 or higher is required and was not found (R shiny)

Go into RStudio and find the system environment variable for RSTUDIO_PANDOC Sys.getenv(“RSTUDIO_PANDOC”) Then put that in your R script prior to calling the render command. Sys.setenv(RSTUDIO_PANDOC=”— insert directory here —“) This worked for me after I’d been struggling to find how rmarkdown finds pandoc. I had to check github to look at the source.

RMarkdown: How to change the font color?

The answer given at the link provided by @Ben Bolker: Roses are <span style=”color:red”>red</span>, violets are <span style=”color:blue”>blue</span>. does work if you select HTML (ioslides) as the output format. However, it does not work if you select pdf (beamer) as output format. If you want to create a pdf, use LaTeX syntax: Roses are \textcolor{red}{red}, … Read more

Programmatically creating Markdown tables in R with KnitR

Now knitr (since version 1.3) package include the kable function for a creation tables: > library(knitr) > kable(head(iris[,1:3]), format = “markdown”) | Sepal.Length| Sepal.Width| Petal.Length| |————-:|————:|————-:| | 5,1| 3,5| 1,4| | 4,9| 3,0| 1,4| | 4,7| 3,2| 1,3| | 4,6| 3,1| 1,5| | 5,0| 3,6| 1,4| | 5,4| 3,9| 1,7| UPDATED: if you get raw … Read more

Rstudio rmarkdown: both portrait and landscape layout in a single PDF

So, pandoc does not parse the content of latex environments, but you can fool it by redefining the commands in your header.tex file: \usepackage{lscape} \newcommand{\blandscape}{\begin{landscape}} \newcommand{\elandscape}{\end{landscape}} Thus, here \begin{landscape} is redefined to \blandscape, and \end{landscape} to \elandscape. Using those newly defined command in the .Rmd file seems to work: — title: “Mixing portrait and landscape” … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)