我不斷收到此錯誤; Rscript --verbose --no-save --no-restore
- 我在這裏也看到過其他人,所以我不希望它重複。Lyx/knitr錯誤
我只是一個'平均喬',想學習一些R,並希望能夠在lyx/knitr報告,因此我不明白乳膠或編碼一般。
這就是說,我會盡力用我最好的能力來描述問題。
我能夠編譯一些在knitr文件夾中提供的演示,以及一些簡單的我已經完成了我自己。但由於某種原因,出現上述錯誤並且文檔被破壞 - 即,即使我刪除了所有代碼,我也無法編譯它。
該錯誤似乎幾乎出現在隨機,在圖片中,你可以看到錯誤。第一個測試進行得很順利 - 儘管當我使用hist()命令時它已經出現了 - 這次它出現在我試圖獲得工作目錄時,我一直無法做到的錯誤。
我不確定它是否是我的最終錯誤,或者它是否是Knitr/Lyx中的錯誤 - 希望您可以幫我確定它是哪一個。
!!編輯; Lyx-log按要求。
22:47:42.732: Previewing ...
22:47:42.739: (buffer-view: Ctrl+R)
22:47:42.779: Rscript --verbose --no-save --no-restore "C:/Program Files (x86)/LyX 2.0/Resources/scripts/lyxknitr.R" "C:/Users/Toddi/AppData/Local/Temp/lyx_tmpdir.Hp4668/lyx_tmpbuf2/""newfile1.Rnw" "C:/Users/Toddi/AppData/Local/Temp/lyx_tmpdir.Hp4668/lyx_tmpbuf2/""newfile1.tex" ISO-8859-15 "C:/Users/Toddi/Documents/"
Running: Rscript --verbose --no-save --no-restore "C:/Program Files (x86)/LyX 2.0/Resources/scripts/lyxknitr.R" "C:/Users/Toddi/AppData/Local/Temp/lyx_tmpdir.Hp4668/lyx_tmpbuf2/""newfile1.Rnw" "C:/Users/Toddi/AppData/Local/Temp/lyx_tmpdir.Hp4668/lyx_tmpbuf2/""newfile1.tex" ISO-8859-15 "C:/Users/Toddi/Documents/"
22:47:43.408:
|
| | 0%
|
22:47:43.409:
|...................... | 33%
22:47:43.409: ordinary text without R code
22:47:43.409:
22:47:43.409:
|
|........................................... | 67%
22:47:43.409: label: test
22:47:43.410: running
22:47:43.410: 'C:\PROGRA~1\R\R-30~1.1\bin\i386\Rterm.exe --slave --no-restore --no-save --no-restore --file=C:/Program Files (x86)/LyX 2.0/Resources/scripts/lyxknitr.R --args C:/Users/Toddi/AppData/Local/Temp/ly
22:47:43.410: x_tmpdir.Hp4668/lyx_tmpbuf2/newfile1.Rnw C:/Users/Toddi/AppData/Local/Temp/lyx_tmpdir.Hp4668/lyx_tmpbuf2/newfile1.tex ISO-8859-15'
22:47:43.411:
22:47:43.411:
22:47:43.411:
22:47:43.411: processing file: C:/Users/Toddi/AppData/Local/Temp/lyx_tmpdir.Hp4668/lyx_tmpbuf2/newfile1.Rnw
22:47:43.456:
22:47:43.457: Advarsel i block_exec(params) :
22:47:43.457: failed to tidy R code in chunk <test>
22:47:43.459: reason: Error in base::parse(text = text, srcfile = NULL) : 3:1: unexpected '@'
22:47:43.459: 2: hist(q)
22:47:43.459: 3: @
22:47:43.460: ^
22:47:43.460:
22:47:43.460: Quitting from lines 11-15 (C:/Users/Toddi/AppData/Local/Temp/lyx_tmpdir.Hp4668/lyx_tmpbuf2/newfile1.Rnw)
22:47:43.461: Fejl i parse(text = x, srcfile = src) : <text>:3:1: unexpected '@'
22:47:43.461: 2: hist(q)
22:47:43.461: 3: @
22:47:43.461: ^
22:47:43.461: Calls: knit ... evaluate -> parse_all -> parse_all.character -> parse
22:47:43.461: Execution halted
..\..\..\src\support\Systemcall.cpp (273): Systemcall: 'Rscript --verbose --no-save --no-restore "C:/Program Files (x86)/LyX 2.0/Resources/scripts/lyxknitr.R" "C:/Users/Toddi/AppData/Local/Temp/lyx_tmpdir.Hp4668/lyx_tmpbuf2/""newfile1.Rnw" "C:/Users/Toddi/AppData/Local/Temp/lyx_tmpdir.Hp4668/lyx_tmpbuf2/""newfile1.tex" ISO-8859-15 "C:/Users/Toddi/Documents/"' finished with exit code 1
Error: Cannot convert file
----------------------------------------
An error occurred while running:
Rscript --verbose --no-save --no-restore "C:/Program Files (x86)/LyX
2.0/Resources/scripts/lyxknitr.R"
"C:/Users/Toddi/AppData/Local/Temp/lyx_tmpdir.Hp4668/lyx_tmpbuf2/""newfile1....
22:51:00.499: Automatic save done.
22:51:51.362: Error while previewing format: pdf2
編輯2;
你的意思是這個;
% Preview source code for paragraph 0
<<test>>=
q <- rnorm(100)
hist(q)
@<<test2>>=
getwd()
@
我已經添加了一行@
和<<test>>=
之間,它現在的作品。但我認爲我已經看到它在代碼位之間有文本的地方失敗了。我會小心這一點,並嘗試在未來看看源代碼,謝謝你的時間!
請編輯你的文章並粘貼完整的消息日誌在這裏(在LyX,'查看 - >查看消息') –
我有一個後續問題;當我退出一個teX代碼框時,我碰到了esc - 並且這導致了錯誤,我可以在源代碼中看到它變成了@(後面是我寫的任何東西),如上例所示。我可以解決這個問題,在esc之後輸入,這是「正確」的方式,還是有更好的退出代碼框的方式? – user2624239
我不知道。我從來沒有打過'Esc' - 我只是用鼠標點擊或右箭頭移出ERT框。 –