Executing R script from CMD failing on rmarkdown::render()

时间:2018-07-25 04:34:57

标签: r cmd r-markdown

Here is my error:

> rmarkdown::render("log-eda.Rmd")
Error in tools::file_path_as_absolute(input) :
  file 'log-eda.Rmd' does not exist
Calls: <Anonymous> -> setwd -> dirname -> <Anonymous>
In addition: Warning message:
In normalizePath(path.expand(path), winslash, mustWork) :
  path[1]="log-eda.Rmd": The system cannot find the file specified
Execution halted

Here is my script createRmd.R:

rmarkdown::render("log-eda.Rmd")
mailR::send.mail(from = "Redacted",
                 to = "Redacted",
                 subject = paste0(format(Sys.Date(), "%B %d, %Y"), " App Report"),
                 body = " ",
                 smtp = list(host.name = "smtp.gmail.com", port = 465, 
                             user.name = "Redacted", 
                             passwd = "Redacted", 
                             ssl = TRUE),
                 authenticate = TRUE,
                 send = TRUE,
                 attach.files = c("log-eda.html"),
                 debug = TRUE)

I've tried a lot of different methods for executing the script, but the most recent one was: Rscript AppReports\createRmd.R

Most of the different methods I try result in the error above. Also I'm using Windows.

0 个答案:

没有答案