6
我无法为由knit2html或其依赖函数生成的html指定输出路径。我想在调用指定“OUTFILE”到knit2html(),但我得到的错误,指定knit2html的输出路径
错误knit2html(输入=“test.Rmd”,输出=“测试abcd.html” ):
对象OUTFILE'未找到
“输出”是markdownToHTML的一个参数,它应该工作,我会想。我无法在使用'outfile'的源代码中找到任何地方。
这应该重现我的经验。
library(knitr)
library(markdown)
# a minimal example
writeLines(c("```{r hello-random, echo=TRUE}", "rnorm(5)", "```"),
"test.Rmd")
# this works and outputs to test.html
knit2html(input = "test.Rmd")
# this generates the above error
knit2html(input = "test.Rmd",
output = "test-abcd.html")
# breaking it down into two steps works in this simple case,
# but not in my application. trying to diagnose that difference currently
knit("test.Rmd")
markdownToHTML("test.md",
output="test-abcd.html")
相关版本信息可能很有帮助?
sessionInfo()
R version 3.0.0 (2013-04-03)
Platform: x86_64-pc-linux-gnu (64-bit)
other attached packages:
[1] plyr_1.8 knitr_1.2 digest_0.6.3 markdown_0.5.4 xtable_1.7-1 reshape2_1.2.2 scales_0.2.3 ggplot2_0.9.3.1 data.table_1.8.8
Thanks @juba,我想这会让这个休息。我认为我甚至已经看过这个功能,但是一定是错过了解决问题模糊中的重要部分。我想理想情况下,它会检查'输出',如果没有给出,只使用默认名称。 – 2013-04-30 14:41:17
@SamSwift对于麻烦抱歉;它是在开发版本中已修复的knitr错误:https://github.com/yihui/knitr – 2013-05-15 13:21:15
注意:要阅读'sub_ext'的源代码,您需要使用_three_打印:''s:' knitr ::: sub_ext'。 – isomorphismes 2014-12-23 22:13:36