0

My goal is to render a R script as a Rmarkdown pdf. When I try to render a Rscript using first knitr::spin() to convert it to a .Rmd file and then rmarkdown::render to render the rmd file to a pdf I get the error message:

> rmarkdown::render("testcars.Rmd", "pdf_document")


processing file: testcars.Rmd
  |..............................................                                                                                            |  33%
  ordinary text without R code

  |............................................................................................                                              |  67%
label: unnamed-chunk-1
Quitting from lines 3-16 (testcars.spin.Rmd) 
Error in sink(con, split = debug) : sink stack is full

I get the same error when I try to use rmarkdown::render() on a .R file.

Here is the Rscript I tried to convert into a Rmarkdown PDF:

library(rmarkdown)
setwd("C:/myworkingdirectory")

data(cars)
str(cars)
summary(cars)
plot(cars)

hist(cars$speed)
boxplot(cars$dist)

knitr::spin(hair = "testcars.R", knit = F, format=c("Rmd"))
rmarkdown::render("testcars.Rmd", "pdf_document")

Phil
  • 7,287
  • 3
  • 36
  • 66
mxmgi
  • 17
  • 2
  • Uncertain if this is the issue, but do you have LaTeX installed? Converting to PDF requires LaTeX. – Ben Norris Sep 04 '20 at 10:46
  • It returns the same error message when I try to render it as a html file. Also I have LaTeX installed already. – mxmgi Sep 04 '20 at 11:23
  • Does this answer your question? [Sink is full when calling rmarkdown::render](https://stackoverflow.com/questions/38455703/sink-is-full-when-calling-rmarkdownrender) – Phil Sep 04 '20 at 14:24

0 Answers0