r-markdown

Output of fa2latex command from psych causing LaTeX error in pandoc

别说谁变了你拦得住时间么 提交于 2019-12-12 02:26:58
问题 I am writing a report using knitr in RStudio. Also using the psych package for factor analysis: ```{r, results='asis'} library(psych) data(Thurstone) fa.Thurstone<-fa(Thurstone) fa2latex(fa.Thurstone) ``` When I run this code chunk it causes an error: ! LaTeX Error: Unknown float option `d'. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.124 \begin{scriptsize} \begin{table}[htdp] pandoc: Error producing PDF from TeX source Error: pandoc

Compile RMarkdown PDF with Waffle Chart and Glyphs FAILURE. MWE included

偶尔善良 提交于 2019-12-12 02:17:22
问题 I am unable to compile PDF using RMarkdown, the waffle package, and glyphs It doesn't matter if I use the TIKZ device or PDF rendering. The document compiles without a problem to HTML. The only work around I can think of right now is to create SVG graphic with the HTML compiler, then to reference those files in my intermediate .TEX file. Notice that if you simply run the code below the line that says, " ## ---- waffle_figure ---- ". It should create the chart given that you've previously

rmarkdown equation in Word non-numbers are q‌u‌e‌s‌t‌i‌o‌n marks

走远了吗. 提交于 2019-12-12 02:00:25
问题 In RStudio rmarkdown equation symbols not reproduced in Word. When I click Knit Word this "$A = \pi*r^{2}$" becomes this in the Word doc "? = ? * ?^2" no problem with html, pdf 来源: https://stackoverflow.com/questions/26719753/rmarkdown-equation-in-word-non-numbers-are-question-marks

Display two rCharts NVD3 figures next to each other in rmarkdown

拈花ヽ惹草 提交于 2019-12-12 01:53:33
问题 I want to display two charts with the rCharts package, one next to the other, more or less like the two pies are displayed in this link: http://nvd3.org/examples/pie.html I have a partial solution using <iframe> , but the solution has three problems: It is too case specific Including controls becomes a complicated task It does not look too nice Minimum working example: --- title: "Example" output: html_document --- ```{r rcht, message=FALSE, echo=FALSE, results='asis'} library(rCharts) df<

how to use a for loop in rmarkdown?

狂风中的少年 提交于 2019-12-12 00:57:27
问题 Consider this simple example: --- title: "Untitled" output: ioslides_presentation --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = FALSE) ``` ## Slide with R Output ```{r t, warning=FALSE, message=FALSE} library(knitr) library(kableExtra) library(dplyr) for(threshold in c(20, 25)) { cars %>% filter(dist < threshold) %>% kable('html') %>% kable_styling(bootstrap_options = "striped") } ``` Here I simply want to print each output of the for loop into a different slide. In this

Bullet color in Xaringan presentation

自古美人都是妖i 提交于 2019-12-11 23:41:54
问题 Is it possible to change the bullet colors in Xaringan presentation? The text should have a different color. I have not find any option in xaringanthemer package neither going through the css file. I could not find any information remark.js documentation. 回答1: You can change the bullet point colour by adding a custom CSS to the YAML header of your Xaringan presentation. Following is a fully reproducible minimal example. Markdown file title: "Example" author: "Author" date: "`r Sys.Date()`"

What is the difference between knitHTML and rmarkdown render?

社会主义新天地 提交于 2019-12-11 22:09:31
问题 I am using RStudio version 0.98.501, R version 3.0.2 on Windows 7. I have following code written in a .Rmd file: --- title: "Sample Document" output: html_document: toc: true theme: united --- Title ======================================================== This is an R Markdown document. Markdown is a simple formatting syntax for authoring web pages (click the **Help** toolbar button for more details on using R Markdown). When you click the **Knit HTML** button a web page will be generated

R Knit Markdown code chunk: “object not found”

独自空忆成欢 提交于 2019-12-11 18:22:27
问题 New to markdown and knit, so... In RStudio, this markdown code does well ## 'r': razão entre opções ```{r} round(apply(rst0[,c('rstQ','rstV','rstMkt','rstMkt2','rstAntiMkt')],2,mean),3) ``` rstQ rstV rstMkt rstMkt2 rstAntiMkt 81.408 111.098 0.012 0.007 0.005 But when I click knit button, I get error: Line 20 Error in apply(rst0[,c('rstQ','rstV','rstMkt','rstMkt2','rstAntiMkt')], : object 'rst0' not found Calls: <Anonimous> ... withCallingHandlers -> withVisible -> eval -> eval -> apply But

How to do nested selections selectInput() in RMarkdown with Shiny?

ⅰ亾dé卋堺 提交于 2019-12-11 17:39:48
问题 In a snippet of code below from my RMarkdown \ flexdashboard code with shiny , I need to modify the choices for the second selectInput() function, based on the selection made at the first selectInput() function. selectInput('theme', 'Select theme:', choices = c(dtThemes$Theme %>% unique())) selectInput('question', 'Select Question:', choices = c(dtQuestions$Question %>% unique())) # This works #choices = strQuestions) # This does not work strQuestions <- reactive({ nQuestions <- dtThemes

Cross-reference figure in a separate Rmarkdown (PDF) file

自作多情 提交于 2019-12-11 17:26:00
问题 I am working on a project with two separate .Rmd files that are part of the same project. One file contains text and equations mainly and the other file contains figures/plots. Is it possible to cross-reference the figures from the second file into the first .Rmd file? File_1.Rmd The following formula has revolutionized the car manufacturing industry. It predicts the mileage per gallon of a car based on its weight. $$ mpg = f(wt) $$ The formula is illustrated in Figure \@ref(fig:File_2.Rmd