0
votes

I ran into this today. I installed R 3.4.3 along side R 3.4.1 . Using LyX/knitr under R 3.4.1 everything was fine. After adding R 3.4.3, changing the System/User/LyX PATH entries from 3.4.1 to 3.4.3, LyX launches Rscript, but it can no longer open the Rnw file in the TEMP folder. LyX freaks out and pops up an error message. My work around was to copy Rscript from R 3.4.1 and everything works again. Did the command line parameters change from R-3.4.1 toR-3.4.3 ?

Everything seems fine for Rstudio and report compilation. Do the LyX Rscript command line parameters need to be changed for R-3.4.3 ? This occurred under Windows 10 on a X64 laptop and i386 tablet. It's consistent anyway! Is there a fix for R-3.4.3 or LyX 2.2.3 ?

Updated info:

The LyX console reports the following:

18:10:32.825: Rscript --verbose --no-save --no-restore "C:/Users/dave/AppData/Local/LyX 2.2/Resources/scripts/lyxknitr.R" "C:/Users/dave/AppData/Local/Temp/lyx_tmpdir.WeWWkafx7016/lyx_tmpbuf0/""DES-knitr.Rnw" "C:/Users/dave/AppData/Local/Temp/lyx_tmpdir.WeWWkafx7016/lyx_tmpbuf0/""DES-knitr.tex" ISO-8859-15 "C:/Users/dave/LaTeX Work/Lyx Work/"

18:10:33.241: The filename, directory name, or volume label syntax is incorrect.
support/Systemcall.cpp (291): Systemcall: 'Rscript --verbose --no-save --no-restore "C:/Users/dave/AppData/Local/LyX 2.2/Resources/scripts/lyxknitr.R" "C:/Users/dave/AppData/Local/Temp/lyx_tmpdir.WeWWkafx7016/lyx_tmpbuf0/""DES-knitr.Rnw" "C:/Users/dave/AppData/Local/Temp/lyx_tmpdir.WeWWkafx7016/lyx_tmpbuf0/""DES-knitr.tex" ISO-8859-15 "C:/Users/dave/LaTeX Work/Lyx Work/"' finished with exit code 1
Error: Cannot convert file

----------------------------------------
An error occurred while running:
Rscript --verbose --no-save --no-restore $$s/scripts/lyxknitr.R
"C:/Users/dave/AppData/Local/Temp/lyx_tmpdir.WeWWkafx7016/lyx_tmpbuf0/""DES-kn…
18:10:41.526: Error while exporting format: PDF (pdflatex)

The tempfile exists and I can read it in Notepad++. Note that LyX works fine, R-3.4.3 works fine, but the LyX->Knitr->R->LaTeX-> PDF chain is broken in Rscript. For every installed R upgrade, I've changed the System/User/LyX PATH variables and everything has been fine with knitr until now. My next step is to completely uninstall LyX and R-3.4.3 and reinstall. I'm a little hesitant to proceed with that if I have a simple configuration change/error that may appear again in future upgrades to LyX (2.3) and R (3.4.3+).

1
I've been using LyX 2.2.3 along with R 3.4.3 for a while, every day, without any problems. I'm on Ubuntu though, so perhaps there's something Windows-specific going on.scottkosty
I took the "C:\Program Files\R\R-3.4.3\bin" from the LyX PATH variable and everything seems normal again...knitr's well again. I'll wait a few more days before closing.user50506
Well, I cleaned up the PATH on 2 x64 and 1 i386 machines. I ran into the problem again and my solution for now is to use Rscript from R-3.4.2. In all cases I reinstalled LyX 2.2.3. Rscript gets called but it cannot find/open the generated Rnw file in the Temp folder. It's there and readable for all except Rscript from R-3.4.3. Anyone else had similar issues?user50506

1 Answers

0
votes

I think the problem is that there are two different bin directories for R, one for x64, and one for i386.

So make sure LyX is configured to use the i386 path if you are on a 32 bit machine, e.g.

C:\R\bin\i386\