【发布时间】:2017-11-03 04:31:35
【问题描述】:
我有一个非常简单的 knitr 脚本。它与我的 Windows 笔记本电脑上的 rstudio 完美配合。
---
title: "Descriptives and PCA"
output:
pdf_document: default
html_document: default
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning=FALSE, message=FALSE)
```
#TEST
```{r}
print(getwd())
```
我使用以下脚本在 linux 集群上运行脚本
cd ./__workspace/R/pipeline
Rscript -e "library(knitr); stitch('pipelineDescriptive.Rmd')"
它不起作用。它打印出一个 pdf,它只是 Rmd 文件代码的副本。
控制台打印出以下两个问题:
|................................ | 50%
label: auto-report
Error in parse(text = code, keep.source = FALSE) :
attempt to use zero-length variable name
|......................................... | 62%
Warning message:
In highr::hilight(x, format, prompt = options$prompt, markup = opts$markup) :
the syntax of the source code is invalid; the fallback mode is used
有人对如何解决这个问题有任何建议吗?
【问题讨论】:
-
几个 cmets:1) 使用
stitch_rmd然后 50 % 的错误应该消失。 2) 为什么不使用Rscript -e "library(markdown); render('pipelineDescriptive.Rmd')"? -
有效!也许你可以发布作为答案。值得点赞。注意,我认为库是 rmarkdown 渲染是 rmarkdown::render
-
是的,应该是
rmarkdown