我可以将现有的 .Rnw Sweave 文件导入 LyX 吗?

我可以将现有的 .Rnw Sweave 文件导入 LyX 吗?

我正在尝试将现有的 Sweave.Rnw文件导入 LyX。我想知道 LyX 是否可以做到这一点?我的 LyX 版本是 2.02,我可以毫无问题地使用它的 Sweave 模块。我发现它确实有一个导入 Sweave 选项,但我无法导入最简单的.Rnw文件,例如下面的文件。

\documentclass{article}
\usepackage{Sweave}
\author{ZZ}

\begin{document}
\title{Simple}
\maketitle
\section{Simple Examples}
A simple example:
<<>>=
N <- 5
N
@
\end{document}

当我尝试导入此文件时,它显示以下错误消息:

An error occurred while running:
Rscript --verbose --no-save --no-restore
"/Applications/LyX.app/Contents/Resources/scripts/lyxsweave.R"
"/Volumes/COMMON/Documents/""addone.Rnw"
"/Volumes/COMMON/Documents/""addone.tex"
"/Volumes/COMMON/Documents/"

我做错了什么吗?我应该换一种方式做吗?

相关内容