r-markdown

rChart in R Markdown doesn't render

孤街浪徒 提交于 2019-12-04 10:01:35
问题 I am having issues rendering an rChart made with 'nPlot' when I knit an R Markdown document to html. I followed the solution discussed in this question, but it was unsuccessful. Here is my .Rmd code ```{r, echo=FALSE} library(knitr) ``` --- title: "Untitled" author: "Test" date: "01/23/2015" output: html_document --- This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown

Can't knit to pdf with custom styles

时光总嘲笑我的痴心妄想 提交于 2019-12-04 09:50:00
Trying to knit to pdf from RStudio using a custom mystyles.sty file. This used to work fine but now that I have upgraded to RStudio 1.044 I get an error. Example: --- title: "Test" output: pdf_document: includes: in_header: mystyles.sty --- ## R Markdown This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>. When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the

Title not showing on R Markdown with knitr when rendering markdown file

ぃ、小莉子 提交于 2019-12-04 09:40:54
I am trying to convert a .Rmd file to .md (output: md_document), but the title does not show up on the rendered file. The title does show up when I try to render the same file as an .html file (output: html_document). Title shows up on rendered document: --- title: "Test" output: html_document --- ```{r} head(cars) ``` Title does not show up on rendered document: --- title: "Test" output: md_document --- ```{r} head(cars) ``` rmarkdown::render(my_file) Any ideas why? I am using RStudio 0.98.1091 and R 3.1.2 on a Mac 10.9.5. The code in between -- gets interpreted, as my references are rendered

Knitting RMarkdown with ggvis to Word

杀马特。学长 韩版系。学妹 提交于 2019-12-04 09:34:56
When I try to knit a RMarkdown document with ggvis plots to Word, I get the following message from Rstudio. Error: Functions that produce HTML output found in document targeting docx output. Please change the output type of this document to HTML. Execution halted Does there exist an elegant solution (without too much effort) to make this possible, perhaps using export_png and vg2png ? Here is an example: ```{r setup, include=FALSE} library(dplyr) library(ggvis) ``` The following table looks fine... As long as I don't include this plot below ```{r, echo=FALSE, include=FALSE} p <- pressure %>%

Error when knitting default RMarkdown file in RStudio

血红的双手。 提交于 2019-12-04 09:07:29
I am using RStudio version 1.1.456, which is running R version 3.5.1. I am running on Windows 7 Enterprise, 64-bit. I'm new to using R Markdown, and so when I opened a new R Markdown file in RStudio, I thought it would be good to run the default code before I tried anything myself. (Note: this is the code that is automatically populated when opening a new Rmd file). --- title: "test" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ## R Markdown This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS

Importing common YAML in rstudio/knitr document

天大地大妈咪最大 提交于 2019-12-04 08:34:34
问题 I have a few Rmd documents that all have the same YAML frontmatter except for the title. How can I keep this frontmatter in one file and have it used for all the documents? It is getting rather large and I don't want to keep every file in step every time I tweak the frontmatter. I want to still use the Knit button/ Ctrl + Shift + K shortcut in RStudio to do the compile keep the whole setup portable: would like to avoid writing a custom output format or overriding rstudio.markdownToHTML (as

R Markdown inline code not executed

左心房为你撑大大i 提交于 2019-12-04 07:59:32
I have an inline code enclosed with single backticks on a single line. However, The cohort had r echo = FALSE load("../data/cohort.rda") nrow(cohort) subjects. is not executed and thus gives me this output in html and pdf: The cohort had r echo = FALSE load("../data/cohort.rda") nrow(cohort) subjects. I want this output: The cohort had 477 subjects. When I exclude echo=FALSE , I get this message: Quitting from lines 33-35 (Manuscript.Rmd) Error in base::parse(text = code, srcfile = NULL) : 1:25: unexpected symbol 1: load("../data/cohort.rda") nrow ^ Calls: ... inline_exec -> withVisible ->

change where rmarkdown saves images generated by r code

笑着哭i 提交于 2019-12-04 07:21:23
I have a rmarkdown document and I'm converting this file to md document. My problem is that I want the pictures created by plots to be placed in a folder called Images in the same directory of the file. Suppose i have this document: --- title: "my test" author: "daniel" date: "18/08/2015" output: md_document --- This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <http://rmarkdown.rstudio.com>. When you click the **Knit** button a document will be generated that includes both content as

Add X-UA-Compatible in rmarkdown html output

℡╲_俬逩灬. 提交于 2019-12-04 07:02:46
I'm trying to add the following tag <meta http-equiv="X-UA-Compatible" content="IE=edge" /> as the first one after <header> in the output of rmkardown HTML document. This is necessary for Internet Explorer, as explained in this MSDN article . This answer does not work for me because the tag is added at the end of <head> and is ignored. My HTML output has some script embedded that is written before the X-UA-Compatible meta tag. Is there a way to add the tag as the first one automatically in rmarkdown? I just ran into this issue too. As people have said in the comments, editing the template html

How to control plot height/size in interactive RMarkdown (with Shiny)

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 06:48:09
I am using Shiny together with RMarkdown to produce an interactive document, as described here . Using the following code, I managed to plot an interactive map ```{r, echo=FALSE, warning=FALSE, message=FALSE} g2g14 <- readOGR("input//geodata", "g2g14") # no projection needs to be specified old_geodata <- g2g14@data inputPanel( selectInput("map.party", label = "Partei", choices = unique(long_data$Partei), selected = "FDP"), selectInput("map.year", label = "Wahljahr", choices = unique(format.Date(long_data$Jahr, "%Y")), selected = "1971") ) renderPlot({ partydata <- long_data %>% filter(Partei =