r-markdown

Unset existing scale_fill_discrete in ggplot2 or suppress message for new scale

社会主义新天地 提交于 2019-12-13 07:26:12
问题 I am currently trying to knit an R markdown document to html (or pdf) where in a certain chunck I generate multiple plots. I specify the captions through the fig.cap argument in the chunck options with a vector of the same length as the number of plots. However, for this to work the cunck option message has to be TRUE . The issue starts when a ggplot2 object is generated by a function in the chucnk and I want to apply a new fill with viridis::scale_fill_viridis . Which is fine, but inevitably

Hide logo and page number only for scrolling slides in RMarkdown

别来无恙 提交于 2019-12-13 06:25:01
问题 I produce a deck of ioslides with logo and page number in RStudio with rmarkdown. If the content is to big for a slide I can add slides > slide { overflow: scroll; } to my .css file and supress the logo and page number with slides > slide:not(.nobackground):after {content: '';} and slides > slide:not(.nobackground):before {background: none;} . But I want to keep the logo and page numbers to every page with no overflow. So I tried to reference the css-styles to the #id of the overfull page but

Working directory issues with knitr - parent and child R Markdown documents

十年热恋 提交于 2019-12-13 05:24:59
问题 I'm having working directory issues when using knitr with parent and child R Markdown documents and external chunks from my R code. I've described the situation and provided links to my code here: https://github.com/yihui/knitr/issues/38 (the issue is closed, but relevant, so I decided to leave my comment there). Would appreciate your help on this! (A copy of this has also been posted to knitr Google Groups.) 来源: https://stackoverflow.com/questions/25705821/working-directory-issues-with-knitr

Automated nicely formated book of lyrics from data.frame using markdown, knitr and glue

╄→гoц情女王★ 提交于 2019-12-13 04:28:32
问题 This is the extension of previous question: Automating the generation of preformated text in Rmarkdown using R. Here's the task: You have a collection of song lyrics stored in data.frame , the columns of which are: song lyrics (with many \n at the end of each line), song title, song album, music author, words author, year, etc... Now you want to produce automatically a nicely formatted book of this poetry using markdown (or bookdown ) and glue packages, which should generate an html of this

Kable caption in rmarkdown file in HTML in bold

爱⌒轻易说出口 提交于 2019-12-13 03:33:05
问题 I want to make my table caption in bold but can't seem to find the option for it. My code is (in a rmarkdown document): kable(head(iris), caption = 'I want this in Bold') %>% kable_styling(bootstrap_options = c("striped", "hover", "condensed", "responsive")) The output is: 回答1: Does this markdown-oriented solution work for you? ```{r, results='asis'} kable(head(iris), caption = '**I want this in Bold**') %>% kableExtra::kable_styling(bootstrap_options = c("striped", "hover", "condensed",

How to write complex kable and ggplot in sections (row and column alignment) to pdf using R Markdown?

邮差的信 提交于 2019-12-13 03:22:38
问题 I am trying to knit several kable and ggplot in sections in one page, details are in the minimal and reproducible example below. I have tried cat("\\twocolumn") kable_styling(position = "float_right") \usepackage{multicol} (Previous Question) Below is the code --- title: "Untitled" output: pdf_document classoption: landscape --- \newpage ```{r cars, echo=FALSE, results="asis", fig.width=3, fig.height=2, message=FALSE} library(dplyr) library(knitr) suppressWarnings(library(kableExtra)) library

compiling latex file generated by RStudio

浪子不回头ぞ 提交于 2019-12-13 02:22:55
问题 I am trying to edit the latex file generated by RStudio but it seems the file generated by RStudio does not compile out of the box. Here is the template rmarkdown (edited a little as I want to show code in my slides) --- title: "Untitled" author: "SN248" date: "April 17, 2016" output: beamer_presentation: keep_tex: true theme: "CambridgeUS" --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` ## R Markdown This is an R Markdown document. Markdown is a simple formatting

Problems using ggvis in rMarkdown with variables

北城余情 提交于 2019-12-13 01:50:27
问题 Hi having a couple of problems a) creating the correct text to pass variables to ggvis - not even sure aes_string is applicable b) The plot propagates in browser rather than rendering in the rmarkdown document Here is an example --- title: "Untitled" author: "pssguy" date: "Sunday, August 24, 2014" output: html_document runtime: shiny --- ```{r, echo = FALSE, message=FALSE} library(ggplot2) library(ggvis) library(dplyr) selectInput("category3", "Choose Dataset:", c("mpg", "disp", "qsec")) #

Table way too wide to fit in Markdown generated PDF

烂漫一生 提交于 2019-12-13 01:34:58
问题 I am trying to display a table from an SQL query to a pdf by using Rmarkdown. However, the table I get is too wide and it does not fit in the document. I have been recommended to use the Pander package, and so I tried to use the pandoc.table() function which works greatly on the console, but for some reason it stops my document from rendering in Rmarkdown. The code looks kinda like this : rz = dbSendQuery(mydb, "select result.id result_id, company.id company_id, (...)") datz = fetch(rz, n=-1)

Make R Markdown code blocks into math mode

旧巷老猫 提交于 2019-12-13 01:27:21
问题 I would love to use R Markdown to generate homework and exam solutions, but I would prefer to have them more readable to non-coders. I there a way that I can pass the ECHO output through math mode? That is I would love to have an ECHO that looks more "inline" and less like code. I can see how to hide it, but in the R Markdown Reference Guide I don't see an option to remove the "code block" and wrap each line in $$ (or wrap in anything). Is there a way to do this? Here is an example. This