knitr

“Compile pdf” in Rstudio works but knit2pdf does not work in R or RStudio

不羁的心 提交于 2020-01-17 07:40:52
问题 I'm hoping someone can point me to the internal setting that can fix my issue with compiling tex docs from R. My issues is that texi2pdf and knit2pdf throw warnings and do not generate a pdf. I can get Rnw files to compile using the "Compile pdf" button in RStudio, I can knit rnw files into text files, and I can get my tex files to compile into pdf using TeXnicCenter, but I can't get the texi2pdf or knit2pdf functions to work in R. In Windows 7 on one machine with TexLive installed and on

How do I assign the working directory for rmarkdown/knitr interactive doc on shinyApps.io?

一笑奈何 提交于 2020-01-17 06:54:26
问题 I have a fully functional interactive shiny doc using knitr/r markdwon. However, when I try to publish (deploy) it to shinyApps.io, I get an error saying the .PNG file I try to incorporate into the doc (using readPNG from the png package) is unable to open. I know the problem is related to working directories. In my original code I assigned a working directory to my folder (i.e., "C:/Users/NAME/documents/...." that contains both my .rmd file and my .png file. However, obviously my folder

knitr will no longer compile: “Error in .First()”

耗尽温柔 提交于 2020-01-17 05:06:10
问题 When I opened R today (via RStudio), I saw the following come up in red text in the Console: Loading required namespace: ffbase Error in .First() : could not find function "load.ffdf" This is also showing up in base R. I tried compiling an .rnw file via knitr today (using RStudio) and saw the following: Loading required namespace: ffbase Error in .First() : could not find function "load.ffdf" Execution halted I've never seen this issue before, the .rnw compilation has worked in the past, and

Custom layout for 2 plots using knitr

删除回忆录丶 提交于 2020-01-17 03:49:46
问题 What I want is to display 2 figures next to each other in one row, so that the first one is square and the second one takes all the remaining width, it should be wider than the first one (I use knitr and LaTeX). I tried using r layout and specify out.width and out.height in a figure chunk options, but I could not get it right and I'm not sure this is the right approach. And in general, it is better to configure figure size in chunk options, right? But what's the best approach for more complex

Cannot release memory with knitr

我怕爱的太早我们不能终老 提交于 2020-01-15 12:25:08
问题 I have an issue with knitr where I run can the code in the console without a problem but run out of memory when I knit the document. The markdown document is similar to --- title: "xyz" output: html_document: toc: true date: "`r format(Sys.time(), '%d %B, %Y')`" author: Me bibliography: ../ref.bib --- ```{r setup, include = FALSE, cache = FALSE} options(width = 100, digits = 3, scipen = 8) knitr::opts_chunk$set( error = FALSE, cache = FALSE, cache.path = "some-path-cache/", fig.path = "some

RStudio Knitr failed to convert Rmd to PDF (Windows 7)

对着背影说爱祢 提交于 2020-01-15 09:37:22
问题 I wanted to use RStudio (Version 0.99.903) and knitr to convert a .Rmd file (please see below) to a PDF file. --- title: "test" output: pdf_document --- Roses are \textcolor{red}{red}, violets are \textcolor{blue}{blue}. When I run "Knit PDF" I got the following error message: processing file: test.Rmd output file: test.knit.md ! Undefined control sequence. l.87 Roses are \textcolor pandoc.exe: Error producing PDF Error: pandoc document conversion failed with error 43 In addition: Warning

plot.new error in R markdown

浪子不回头ぞ 提交于 2020-01-15 09:26:40
问题 I have some R code to plot an ellipse for a bivariate normal with known mean and variance using the ellipse() function from the mixtools package. However when I run this in Rmarkdown I get an error saying "plot.new has not been called yet". When I put another plot directly above it in the same chunk it runs but otherwise I get the error. What's the reason for this? plot(ellipse(params,covariance, npoints = 500, alpha=0.01), xlim = c(-2,3.5), ylim = c(0,.75), xlab="alpha", ylab = "beta") This

HTML widgets alignment in rmarkdwon

徘徊边缘 提交于 2020-01-15 08:53:32
问题 I use the knitr::opts_chunk$set(fig.align = "center") at the beginning of the rmarkdown document to set the alignment of figures. When I output HTML files, the static figures are aligned to the center, but the HTML widgets, such as outputs from leaflet() and ggplotly() have the default alignment (to the left). Is there an option to force the HTML widgets to the center? EDIT: example given below. --- title: "test" output: html_document --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo

Knitr HTML Loop - Some HTML output, some R output

落花浮王杯 提交于 2020-01-15 07:58:48
问题 i want to loop through a list and and print some part of it in HTML and some as Code. So be more precise: I want to produce the same output this is creating <h2> 1 is a great number </h2> <!--begin.rcode echo=FALSE print(rnorm(5,mean=1)) end.rcode--> <h2> 2 is a great number </h2> <!--begin.rcode echo=FALSE print(rnorm(5,mean=2)) end.rcode--> ... <h2> x is a great number </h2> I managed to print the 's to HTML but the results are printed directly in HTML as well, with the following Chunk: <!-

ImageMagick PATH not being recognized with engine = “tikz” in knitr

做~自己de王妃 提交于 2020-01-15 06:14:27
问题 I am trying to compile TikZ graphics from knitr . I am using the example available here. I am specifically trying to knit from Rstudio. The output I get from the "R Markdown" tab is as follows: processing file: test.Rmd Invalid Parameter - /test_files Quitting from lines 16-31 (test.Rmd) Error in (knit_engines$get(options$engine))(options) : problems with `convert`; probably not installed? Calls: <Anonymous> ... process_group.block -> call_block -> block_exec -> in_dir -> <Anonymous>