yihui / lyx-R

support for R in LyX (Sweave and knitr, ...)
http://yihui.name/knitr/demo/lyx/
28 stars 11 forks source link

lyx File -> Export -> R/S code not working on knitr-minimal.lyx #7

Closed MartinInFrankfurtAM closed 12 years ago

MartinInFrankfurtAM commented 12 years ago

Great work, Yihui!

When I try to export R/S code from knitr.minimal.lyx, I get: xxxxx xxxxx 945: output file: .../Knitr/knitr-minimal.tex xxxxx.956: xxxxx.958: [1] FALSE xxxxx.963: Warning message: xxxxx.968 In file.rename(basename(.cmdargs[2]), .cmdargs[2]) : xxxxx:971: cannot rename file 'knitr-minimal.R' to 'tmp/lyx_tmpdir.MT4957/lyx_tmpbuf3/knitr- minimal.R', reason 'Invalid cross-device link' xxxxx.976: Successful export to format : R/S code

Any hints where I can look up such things?

Background: I have only R2.12 in my office - for reasons of compatibility in a worldwide cluster. My immediate barefoot workaround would be to export the R/S code from the final lyx-document (generated under 2.14 on my laptop) and then transfer it to the cluster and check whether it gives the same results under 2.12. (Next week afternoon, I might try to migrate lyxknit.R and knitr to 2.12. - see how naive I am.)

Cheers, Martin

yihui commented 12 years ago

LyX 2.0.3 will be released very soon, so I recommend you use the new stable version (finally I can remove all the old hacks). If you are working on Ubuntu, you do not need to wait: http://yihui.name/knitr/demo/lyx/

MartinInFrankfurtAM commented 12 years ago

Hi Yihui, Thank you for your prompt answer. I should have mentioned that I am using on my laptop (opensuse 11.4) lyx 2.1.0svn with R 2.14 (with your great knitr-module) on my office desktop (opensuse 11.4) lyx2.0.1 with R2.12.(sweave)

Is the svn-lyx-version or the 2.0.3 supposed to be able to export the R/S code from a lyx document? What am I doing wrong? I did copy the lyxknitrR into ~/.lyx/scripts/lyxsweave.R

Cheers, Martin

On Wed, Feb 29, 2012 at 12:03 AM, Yihui Xie < reply@reply.github.com

wrote:

LyX 2.0.3 will be released very soon, so I recommend you use the new stable version (finally I can remove all the old hacks). If you are working on Ubuntu, you do not need to wait: http://yihui.name/knitr/demo/lyx/


Reply to this email directly or view it on GitHub: https://github.com/yihui/lyx/issues/7#issuecomment-4227893

Dr. rer. nat. (NL) Martin A. Burschka Peter-Fischer-Allee 23 65929 Frankfurt am Main Germany Home: +49 69 8700 1881 +49 69 8700 1880 FAX: +49 69 2475 0751 https://www.xing.com/profile/Martin_Burschka

yihui commented 12 years ago

I'm not sure about the svn version; maybe that makes an difference. Anyway, now we do not have to hack at lyxsweave.R, since 2.0.3 has two independent modules for Sweave and knitr respectively. Unfortunately the lyx web server is down at the moment, but you can still get the source from https://launchpad.net/~lyx-devel/+archive/release/+files/lyx_2.0.3.orig.tar.gz (I believe the svn version also works) The point is, it is not recommended to pollute the Sweave module now, so you'd better remove ~/.lyx/scripts/lyxsweave.R.

After about one and a half year, I can avoid compiling LyX from svn now.

MartinInFrankfurtAM commented 12 years ago

Thank you for your helpful hint, Yihui. This made the difference!

On Wed, Feb 29, 2012 at 2:24 AM, Yihui Xie < reply@reply.github.com

wrote:

I'm not sure about the svn version; maybe that makes an difference. Anyway, now we do not have to hack at lyxsweave.R, since 2.0.3 has two independent modules for Sweave and knitr respectively. Unfortunately the lyx web server is down at the moment, but you can still get the source from https://launchpad.net/~lyx-devel/+archive/release/+files/lyx_2.0.3.orig.tar.gzhttps://launchpad.net/%7Elyx-devel/+archive/release/+files/lyx_2.0.3.orig.tar.gz(I believe the svn version also works) The point is, it is not recommended to pollute the Sweave module now, so you'd better remove ~/.lyx/scripts/lyxsweave.R.

After about one and a half year, I can avoid compiling LyX from svn now.


Reply to this email directly or view it on GitHub: https://github.com/yihui/lyx/issues/7#issuecomment-4229890

Dr. rer. nat. (NL) Martin A. Burschka Peter-Fischer-Allee 23 65929 Frankfurt am Main Germany Home: +49 69 8700 1881 +49 69 8700 1880 FAX: +49 69 2475 0751 https://www.xing.com/profile/Martin_Burschka

yihui commented 12 years ago

I'm glad to know it helped. BTW, thanks for the donation :)