Printing R Report marcia hon  2018-02-22 11:28
Status: Closed
 
I am trying:

setwd("directory")

# Load packages
require(knitr)
require(markdown)

# Create .md, .html, and .pdf files
knit("My_Analysis.Rmd")
markdownToHTML('My_Analysis.md', 'My_Analysis.html', options=c("use_xhml"))
system("pandoc -s Sublime.html -o My_Analysis.pdf")



But I get the following error:

javax.script.ScriptException: javax.script.ScriptException: An error occurred when running the script 'script.R', exit code: 1).
Loading required package: knitr
Loading required package: markdown
Error in readLines(if (is.character(input2)) { :
  cannot open the connection
Calls: knit -> readLines
In addition: Warning message:
In readLines(if (is.character(input2)) { :
  cannot open file 'My_Analysis.Rmd': No such file or directory
Execution halted