Re: Sweave manual pdf compilation fails

2012-02-02 Thread Richard Heck

On 02/01/2012 05:47 PM, Yihui Xie wrote:

I'm pretty confident with this one. It does not have specific
requirements on R versions, and users do not have to upgrade R.
If you and JMarc agree, it can go into 2.0.3. I know nothing about this 
stuff.


Richard


Regards,
Yihui
--
Yihui Xiexieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Wed, Feb 1, 2012 at 4:29 PM, Jean-Marc Lasgoutteslasgout...@lyx.org  wrote:

Le 01/02/12 20:16, Yihui Xie a écrit :


The patch is pretty simple: http://www.lyx.org/trac/ticket/8019


It looks like a reasnable thing to do, if it does what I think it does. How
confident are you with this patch? Does it rely only on documented
behaviour, assumed to be present in earlier R versions? We do not want to
force people to upgrade to latest R.

JMarc





Re: Sweave manual pdf compilation fails

2012-02-02 Thread Jean-Pierre Chrétien

Le 01/02/2012 20:16, Yihui Xie a écrit :

The patch is pretty simple: http://www.lyx.org/trac/ticket/8019


I removed Sweave.sty from texmf-local, so that LyX cannot find it that way, 
applied the patch, and the Sweave manual compiles now fine from the Help menu.
No failure because of write permission needed to access the LyX tree, nor 
because Sweave.sty is not found in /usr/share/R/texmf/


--
Jean-Pierre


Re: Sweave manual pdf compilation fails

2012-02-02 Thread Richard Heck

On 02/01/2012 05:47 PM, Yihui Xie wrote:

I'm pretty confident with this one. It does not have specific
requirements on R versions, and users do not have to upgrade R.
If you and JMarc agree, it can go into 2.0.3. I know nothing about this 
stuff.


Richard


Regards,
Yihui
--
Yihui Xie
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Wed, Feb 1, 2012 at 4:29 PM, Jean-Marc Lasgouttes  wrote:

Le 01/02/12 20:16, Yihui Xie a écrit :


The patch is pretty simple: http://www.lyx.org/trac/ticket/8019


It looks like a reasnable thing to do, if it does what I think it does. How
confident are you with this patch? Does it rely only on documented
behaviour, assumed to be present in earlier R versions? We do not want to
force people to upgrade to latest R.

JMarc





Re: Sweave manual pdf compilation fails

2012-02-02 Thread Jean-Pierre Chrétien

Le 01/02/2012 20:16, Yihui Xie a écrit :

The patch is pretty simple: http://www.lyx.org/trac/ticket/8019


I removed Sweave.sty from texmf-local, so that LyX cannot find it that way, 
applied the patch, and the Sweave manual compiles now fine from the Help menu.
No failure because of write permission needed to access the LyX tree, nor 
because Sweave.sty is not found in /usr/share/R/texmf/


--
Jean-Pierre


Sweave manual pdf compilation fails

2012-02-01 Thread Jean-Pierre Chrétien

Hello,

I took a look to the new specific manual describing sweave with the latest 
2.0.3svn. The pdf export fails on an Rscript error:


cite
Running: Rscript --verbose --no-save --no-restore 
/usr/local/share/lyx-2.0.3svn/scripts/lyxsweave.R 
/tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.Rnw 
/tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.tex ISO-8859-15 
/usr/local/share/lyx-2.0.3svn/examples/

running
  '/usr/lib/R/bin/R --slave --no-restore --no-save --no-restore 
--file=/usr/local/share/lyx-2.0.3svn/scripts/lyxsweave.R --args 
/tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.Rnw 
/tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.tex ISO-8859-15'


[1] FALSE
Writing to file /tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.tex
Processing code chunks ...
 1 : term verbatim
 2 : echo (label=sweave-sty)
 3 : echo keep.source term verbatim (label=setup)
 4 : echo keep.source (label=sweave-manual)
 5 : echo keep.source term verbatim (label=print-integers)
 6 : echo term hide (label=hide-results)
 7 : echo term verbatim (label=calculator)
 8 : echo term verbatim (label=rnorm)
 9 : echo term verbatim (label=iris-summary)
10 : term tex (label=xtable-demo)
Loading required package: xtable
11 : echo term verbatim eps pdf (label=iris-pairs)

Erreur :  chunk 11 (label=iris-pairs)
Error in function (file = ifelse(onefile, Rplots.pdf, Rplot%03d.pdf),  :
  impossible de démarrer le périphérique pdf
De plus : Messages d'avis :
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return 
= TRUE,  :

  there is no package called 'xtable'
2: In function (file = ifelse(onefile, Rplots.pdf, Rplot%03d.pdf),  :
  impossible d'ouvrir le fichier en argument de 'pdf' 'Rplots.pdf'
Exécution arrêtée
Systemcall.cpp(270): Systemcall: 'Rscript --verbose --no-save --no-restore 
/usr/local/share/lyx-2.0.3svn/scripts/lyxsweave.R 
/tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.Rnw 
/tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.tex ISO-8859-15 
/usr/local/share/lyx-2.0.3svn/examples/' finished with exit code 1

Error: Conversion du fichier impossible
/cite

I installed R and related packages on my Debian box (Squeeze, R version 2.11). 
While updating fr.po for 2.0.3, I saw something about a requirement for R 
version =2.14.

Is that the reason of failure ?

--
Jean-Pierre



Re: Sweave manual pdf compilation fails

2012-02-01 Thread Yihui Xie
I guess you compiled the document under
/usr/local/share/lyx-2.0.3svn/examples/, right?

I believe the problem is that R has no write privilege to that
directory, so the default pdf() device cannot be started there. You
can copy sweave.lyx to a directory where you have write privilege, and
see if it compiles correctly.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



2012/2/1 Jean-Pierre Chrétien jeanpierre.chret...@free.fr:
 Hello,

 I took a look to the new specific manual describing sweave with the latest
 2.0.3svn. The pdf export fails on an Rscript error:

 cite
 Running: Rscript --verbose --no-save --no-restore
 /usr/local/share/lyx-2.0.3svn/scripts/lyxsweave.R
 /tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.Rnw
 /tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.tex ISO-8859-15
 /usr/local/share/lyx-2.0.3svn/examples/
 running
  '/usr/lib/R/bin/R --slave --no-restore --no-save --no-restore
 --file=/usr/local/share/lyx-2.0.3svn/scripts/lyxsweave.R --args
 /tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.Rnw
 /tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.tex ISO-8859-15'

 [1] FALSE
 Writing to file /tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.tex
 Processing code chunks ...
  1 : term verbatim
  2 : echo (label=sweave-sty)
  3 : echo keep.source term verbatim (label=setup)
  4 : echo keep.source (label=sweave-manual)
  5 : echo keep.source term verbatim (label=print-integers)
  6 : echo term hide (label=hide-results)
  7 : echo term verbatim (label=calculator)
  8 : echo term verbatim (label=rnorm)
  9 : echo term verbatim (label=iris-summary)
 10 : term tex (label=xtable-demo)
 Loading required package: xtable
 11 : echo term verbatim eps pdf (label=iris-pairs)

 Erreur :  chunk 11 (label=iris-pairs)
 Error in function (file = ifelse(onefile, Rplots.pdf, Rplot%03d.pdf),  :
  impossible de démarrer le périphérique pdf
 De plus : Messages d'avis :
 1: In library(package, lib.loc = lib.loc, character.only = TRUE,
 logical.return = TRUE,  :
  there is no package called 'xtable'
 2: In function (file = ifelse(onefile, Rplots.pdf, Rplot%03d.pdf),  :
  impossible d'ouvrir le fichier en argument de 'pdf' 'Rplots.pdf'
 Exécution arrêtée
 Systemcall.cpp(270): Systemcall: 'Rscript --verbose --no-save --no-restore
 /usr/local/share/lyx-2.0.3svn/scripts/lyxsweave.R
 /tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.Rnw
 /tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.tex ISO-8859-15
 /usr/local/share/lyx-2.0.3svn/examples/' finished with exit code 1
 Error: Conversion du fichier impossible
 /cite

 I installed R and related packages on my Debian box (Squeeze, R version
 2.11). While updating fr.po for 2.0.3, I saw something about a requirement
 for R version =2.14.
 Is that the reason of failure ?

 --
 Jean-Pierre



Re: Sweave manual pdf compilation fails

2012-02-01 Thread Liviu Andronic
On Wed, Feb 1, 2012 at 5:15 PM, Yihui Xie x...@yihui.name wrote:
 I guess you compiled the document under
 /usr/local/share/lyx-2.0.3svn/examples/, right?

 I believe the problem is that R has no write privilege to that
 directory, so the default pdf() device cannot be started there. You
 can copy sweave.lyx to a directory where you have write privilege, and
 see if it compiles correctly.

Hmm, isn't the compilation supposed to be performed in a /tmp/ dir,
where permissions are available?

Liviu


Re: Sweave manual pdf compilation fails

2012-02-01 Thread Yihui Xie
You are right (ideally), but this is a long-lasting annoying problem
with R's default graphical device which is pdf() in the
non-interactive session. Unfortunately it has to create a file under
the current working directory (usually named Rplots.pdf). I requested
a true null device which does not write files, and it was implemented
in R 2.14.1, but again, unfortunately it has a bug which makes this
null device still write a file named NA. I have not got any response
from R core yet about this bug.

I can submit a simple patch to lyxsweave.R to avoid this problem by
redirecting the default file to a temp dir, but I'm not sure if it is
still in time. It should not break string freeze, though.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Wed, Feb 1, 2012 at 10:18 AM, Liviu Andronic landronim...@gmail.com wrote:
 On Wed, Feb 1, 2012 at 5:15 PM, Yihui Xie x...@yihui.name wrote:
 I guess you compiled the document under
 /usr/local/share/lyx-2.0.3svn/examples/, right?

 I believe the problem is that R has no write privilege to that
 directory, so the default pdf() device cannot be started there. You
 can copy sweave.lyx to a directory where you have write privilege, and
 see if it compiles correctly.

 Hmm, isn't the compilation supposed to be performed in a /tmp/ dir,
 where permissions are available?

 Liviu


Re: Sweave manual pdf compilation fails

2012-02-01 Thread Jean-Pierre Chrétien

Le 01/02/2012 17:15, Yihui Xie a écrit :

I guess you compiled the document under
/usr/local/share/lyx-2.0.3svn/examples/, right?

I believe the problem is that R has no write privilege to that
directory, so the default pdf() device cannot be started there. You
can copy sweave.lyx to a directory where you have write privilege, and
see if it compiles correctly.


Oops, stupid of me, sorry.

--
Jean-Pierre


Re: Sweave manual pdf compilation fails

2012-02-01 Thread Yihui Xie
No, I do not think that is your problem :) See my second reply above.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



2012/2/1 Jean-Pierre Chrétien jeanpierre.chret...@free.fr:
 Le 01/02/2012 17:15, Yihui Xie a écrit :

 I guess you compiled the document under
 /usr/local/share/lyx-2.0.3svn/examples/, right?

 I believe the problem is that R has no write privilege to that
 directory, so the default pdf() device cannot be started there. You
 can copy sweave.lyx to a directory where you have write privilege, and
 see if it compiles correctly.


 Oops, stupid of me, sorry.

 --
 Jean-Pierre


Re: Sweave manual pdf compilation fails

2012-02-01 Thread Jean-Pierre Chrétien

Le 01/02/2012 17:15, Yihui Xie a écrit :

I guess you compiled the document under
/usr/local/share/lyx-2.0.3svn/examples/, right?

I believe the problem is that R has no write privilege to that
directory, so the default pdf() device cannot be started there. You
can copy sweave.lyx to a directory where you have write privilege, and
see if it compiles correctly.


So I opened the example file in the compilation tree (which is under my personal 
account) and the error is gone, but now it does not find Sweave.sty.


The doc itself says it should, but unfortunately the Debian package puts the 
file in

/usr/share/R/texmf

instead of the documented

/usr/share/R/texmf/tex/latex

So I copied the file as

/usr/local/texlive/texmf-local/tex/latex/sweave/Sweave.sty

and ran texhash, and I get the pdf all right.

Seems thus that the manual does not compile out of the box on Debian Squeeze,
due to the path problem.

--
Jean-Pierre


Re: Sweave manual pdf compilation fails

2012-02-01 Thread Yihui Xie
That seems like a bug of Debian; R should be able to find Sweave.sty with

 file.path(R.home(share), texmf, tex, latex, Sweave.sty)
[1] /usr/share/R/share/texmf/tex/latex/Sweave.sty

I'm using Ubuntu and R can find Sweave.sty correctly.

If possible, I strongly recommend you update R to the latest 2.14.1
(it is pretty easy to update if you set a CRAN mirror; see
instructions at http://cran.r-project.org/bin/linux/debian/). There
have been many changes in Sweave since 2.11.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



2012/2/1 Jean-Pierre Chrétien jeanpierre.chret...@free.fr:
 Le 01/02/2012 17:15, Yihui Xie a écrit :

 I guess you compiled the document under

 /usr/local/share/lyx-2.0.3svn/examples/, right?

 I believe the problem is that R has no write privilege to that
 directory, so the default pdf() device cannot be started there. You
 can copy sweave.lyx to a directory where you have write privilege, and
 see if it compiles correctly.


 So I opened the example file in the compilation tree (which is under my
 personal account) and the error is gone, but now it does not find
 Sweave.sty.

 The doc itself says it should, but unfortunately the Debian package puts the
 file in

 /usr/share/R/texmf

 instead of the documented

 /usr/share/R/texmf/tex/latex

 So I copied the file as

 /usr/local/texlive/texmf-local/tex/latex/sweave/Sweave.sty

 and ran texhash, and I get the pdf all right.

 Seems thus that the manual does not compile out of the box on Debian
 Squeeze,
 due to the path problem.

 --
 Jean-Pierre


Re: Sweave manual pdf compilation fails

2012-02-01 Thread Yihui Xie
I think so. If you add a CRAN mirror to your software repository,
Debian knows how to solve the dependencies. There is a Debian
maintainer who has been working on compiling R and some R packages to
Debian packages.

The versions of LyX and TeXLive often have a long time lag in
Debian/Ubuntu, but R gets updated pretty fast if you directly set a
CRAN mirror instead of waiting for other Debian repositories.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



2012/2/1 Jean-Pierre Chrétien jeanpierre.chret...@free.fr:
 Le 01/02/2012 18:20, Yihui Xie a écrit :


 If possible, I strongly recommend you update R to the latest 2.14.1
 (it is pretty easy to update if you set a CRAN mirror; see
 instructions at http://cran.r-project.org/bin/linux/debian/). There
 have been many changes in Sweave since 2.11.


 Sure, I can make a local install of R as I do for TeXLive and LyX, but will
 I get dependency problems with Debian packages ?

 --
 Jean-Pierre


Re: Sweave manual pdf compilation fails

2012-02-01 Thread Jean-Pierre Chrétien

Le 01/02/2012 18:20, Yihui Xie a écrit :


If possible, I strongly recommend you update R to the latest 2.14.1
(it is pretty easy to update if you set a CRAN mirror; see
instructions at http://cran.r-project.org/bin/linux/debian/). There
have been many changes in Sweave since 2.11.


Sure, I can make a local install of R as I do for TeXLive and LyX, but will I 
get dependency problems with Debian packages ?


--
Jean-Pierre


Re: Sweave manual pdf compilation fails

2012-02-01 Thread Liviu Andronic
On Wed, Feb 1, 2012 at 5:29 PM, Yihui Xie x...@yihui.name wrote:
 You are right (ideally), but this is a long-lasting annoying problem
 with R's default graphical device which is pdf() in the
 non-interactive session. Unfortunately it has to create a file under
 the current working directory (usually named Rplots.pdf). I requested
 a true null device which does not write files, and it was implemented
 in R 2.14.1, but again, unfortunately it has a bug which makes this
 null device still write a file named NA. I have not got any response
 from R core yet about this bug.

 I can submit a simple patch to lyxsweave.R to avoid this problem by
 redirecting the default file to a temp dir, but I'm not sure if it is
 still in time. It should not break string freeze, though.

It would be nice, indeed. Richard, JMarc, can such a patch go in for 2.0.3?

Liviu


 Regards,
 Yihui
 --
 Yihui Xie xieyi...@gmail.com
 Phone: 515-294-2465 Web: http://yihui.name
 Department of Statistics, Iowa State University
 2215 Snedecor Hall, Ames, IA



 On Wed, Feb 1, 2012 at 10:18 AM, Liviu Andronic landronim...@gmail.com 
 wrote:
 On Wed, Feb 1, 2012 at 5:15 PM, Yihui Xie x...@yihui.name wrote:
 I guess you compiled the document under
 /usr/local/share/lyx-2.0.3svn/examples/, right?

 I believe the problem is that R has no write privilege to that
 directory, so the default pdf() device cannot be started there. You
 can copy sweave.lyx to a directory where you have write privilege, and
 see if it compiles correctly.

 Hmm, isn't the compilation supposed to be performed in a /tmp/ dir,
 where permissions are available?

 Liviu



-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail


Re: Sweave manual pdf compilation fails

2012-02-01 Thread Yihui Xie
The patch is pretty simple: http://www.lyx.org/trac/ticket/8019

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Wed, Feb 1, 2012 at 12:53 PM, Liviu Andronic landronim...@gmail.com wrote:
 On Wed, Feb 1, 2012 at 5:29 PM, Yihui Xie x...@yihui.name wrote:
 You are right (ideally), but this is a long-lasting annoying problem
 with R's default graphical device which is pdf() in the
 non-interactive session. Unfortunately it has to create a file under
 the current working directory (usually named Rplots.pdf). I requested
 a true null device which does not write files, and it was implemented
 in R 2.14.1, but again, unfortunately it has a bug which makes this
 null device still write a file named NA. I have not got any response
 from R core yet about this bug.

 I can submit a simple patch to lyxsweave.R to avoid this problem by
 redirecting the default file to a temp dir, but I'm not sure if it is
 still in time. It should not break string freeze, though.

 It would be nice, indeed. Richard, JMarc, can such a patch go in for 2.0.3?

 Liviu


 Regards,
 Yihui
 --
 Yihui Xie xieyi...@gmail.com
 Phone: 515-294-2465 Web: http://yihui.name
 Department of Statistics, Iowa State University
 2215 Snedecor Hall, Ames, IA



Re: Sweave manual pdf compilation fails

2012-02-01 Thread Jean-Marc Lasgouttes

Le 01/02/12 20:16, Yihui Xie a écrit :

The patch is pretty simple: http://www.lyx.org/trac/ticket/8019


It looks like a reasnable thing to do, if it does what I think it does. 
How confident are you with this patch? Does it rely only on documented 
behaviour, assumed to be present in earlier R versions? We do not want 
to force people to upgrade to latest R.


JMarc



Re: Sweave manual pdf compilation fails

2012-02-01 Thread Jean-Marc Lasgouttes

Le 01/02/12 18:20, Yihui Xie a écrit :

That seems like a bug of Debian; R should be able to find Sweave.sty with


file.path(R.home(share), texmf, tex, latex, Sweave.sty)

[1] /usr/share/R/share/texmf/tex/latex/Sweave.sty

I'm using Ubuntu and R can find Sweave.sty correctly.

If possible, I strongly recommend you update R to the latest 2.14.1
(it is pretty easy to update if you set a CRAN mirror; see
instructions at http://cran.r-project.org/bin/linux/debian/). There
have been many changes in Sweave since 2.11.


It would be nice if we could find the file even in older versions of R. 
My policy is to do easy thing to support old versions, but not much more :)


JMarc



Re: Sweave manual pdf compilation fails

2012-02-01 Thread Yihui Xie
I'm pretty confident with this one. It does not have specific
requirements on R versions, and users do not have to upgrade R.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Wed, Feb 1, 2012 at 4:29 PM, Jean-Marc Lasgouttes lasgout...@lyx.org wrote:
 Le 01/02/12 20:16, Yihui Xie a écrit :

 The patch is pretty simple: http://www.lyx.org/trac/ticket/8019


 It looks like a reasnable thing to do, if it does what I think it does. How
 confident are you with this patch? Does it rely only on documented
 behaviour, assumed to be present in earlier R versions? We do not want to
 force people to upgrade to latest R.

 JMarc



Re: Sweave manual pdf compilation fails

2012-02-01 Thread Yihui Xie
Yes, that would be ideal. I will update the patch to reflect this
issue. I do not remember in which version R moved Sweave.sty from
texmf to texmf/tex/latex, so let's search both places.

Regards,
Yihui
--
Yihui Xie xieyi...@gmail.com
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Wed, Feb 1, 2012 at 4:38 PM, Jean-Marc Lasgouttes lasgout...@lyx.org wrote:
 Le 01/02/12 18:20, Yihui Xie a écrit :

 That seems like a bug of Debian; R should be able to find Sweave.sty with

 file.path(R.home(share), texmf, tex, latex, Sweave.sty)

 [1] /usr/share/R/share/texmf/tex/latex/Sweave.sty

 I'm using Ubuntu and R can find Sweave.sty correctly.

 If possible, I strongly recommend you update R to the latest 2.14.1
 (it is pretty easy to update if you set a CRAN mirror; see
 instructions at http://cran.r-project.org/bin/linux/debian/). There
 have been many changes in Sweave since 2.11.


 It would be nice if we could find the file even in older versions of R. My
 policy is to do easy thing to support old versions, but not much more :)

 JMarc



Sweave manual pdf compilation fails

2012-02-01 Thread Jean-Pierre Chrétien

Hello,

I took a look to the new specific manual describing sweave with the latest 
2.0.3svn. The pdf export fails on an Rscript error:



Running: Rscript --verbose --no-save --no-restore 
"/usr/local/share/lyx-2.0.3svn/scripts/lyxsweave.R" 
"/tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/""sweave.Rnw" 
"/tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/""sweave.tex" ISO-8859-15 
"/usr/local/share/lyx-2.0.3svn/examples/"

running
  '/usr/lib/R/bin/R --slave --no-restore --no-save --no-restore 
--file=/usr/local/share/lyx-2.0.3svn/scripts/lyxsweave.R --args 
/tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.Rnw 
/tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.tex ISO-8859-15'


[1] FALSE
Writing to file /tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.tex
Processing code chunks ...
 1 : term verbatim
 2 : echo (label=sweave-sty)
 3 : echo keep.source term verbatim (label=setup)
 4 : echo keep.source (label=sweave-manual)
 5 : echo keep.source term verbatim (label=print-integers)
 6 : echo term hide (label=hide-results)
 7 : echo term verbatim (label=calculator)
 8 : echo term verbatim (label=rnorm)
 9 : echo term verbatim (label=iris-summary)
10 : term tex (label=xtable-demo)
Loading required package: xtable
11 : echo term verbatim eps pdf (label=iris-pairs)

Erreur :  chunk 11 (label=iris-pairs)
Error in function (file = ifelse(onefile, "Rplots.pdf", "Rplot%03d.pdf"),  :
  impossible de démarrer le périphérique pdf
De plus : Messages d'avis :
1: In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return 
= TRUE,  :

  there is no package called 'xtable'
2: In function (file = ifelse(onefile, "Rplots.pdf", "Rplot%03d.pdf"),  :
  impossible d'ouvrir le fichier en argument de 'pdf' 'Rplots.pdf'
Exécution arrêtée
Systemcall.cpp(270): Systemcall: 'Rscript --verbose --no-save --no-restore 
"/usr/local/share/lyx-2.0.3svn/scripts/lyxsweave.R" 
"/tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/""sweave.Rnw" 
"/tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/""sweave.tex" ISO-8859-15 
"/usr/local/share/lyx-2.0.3svn/examples/"' finished with exit code 1

Error: Conversion du fichier impossible


I installed R and related packages on my Debian box (Squeeze, R version 2.11). 
While updating fr.po for 2.0.3, I saw something about a requirement for R 
version >=2.14.

Is that the reason of failure ?

--
Jean-Pierre



Re: Sweave manual pdf compilation fails

2012-02-01 Thread Yihui Xie
I guess you compiled the document under
/usr/local/share/lyx-2.0.3svn/examples/, right?

I believe the problem is that R has no write privilege to that
directory, so the default pdf() device cannot be started there. You
can copy sweave.lyx to a directory where you have write privilege, and
see if it compiles correctly.

Regards,
Yihui
--
Yihui Xie 
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



2012/2/1 Jean-Pierre Chrétien :
> Hello,
>
> I took a look to the new specific manual describing sweave with the latest
> 2.0.3svn. The pdf export fails on an Rscript error:
>
> 
> Running: Rscript --verbose --no-save --no-restore
> "/usr/local/share/lyx-2.0.3svn/scripts/lyxsweave.R"
> "/tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/""sweave.Rnw"
> "/tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/""sweave.tex" ISO-8859-15
> "/usr/local/share/lyx-2.0.3svn/examples/"
> running
>  '/usr/lib/R/bin/R --slave --no-restore --no-save --no-restore
> --file=/usr/local/share/lyx-2.0.3svn/scripts/lyxsweave.R --args
> /tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.Rnw
> /tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.tex ISO-8859-15'
>
> [1] FALSE
> Writing to file /tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/sweave.tex
> Processing code chunks ...
>  1 : term verbatim
>  2 : echo (label=sweave-sty)
>  3 : echo keep.source term verbatim (label=setup)
>  4 : echo keep.source (label=sweave-manual)
>  5 : echo keep.source term verbatim (label=print-integers)
>  6 : echo term hide (label=hide-results)
>  7 : echo term verbatim (label=calculator)
>  8 : echo term verbatim (label=rnorm)
>  9 : echo term verbatim (label=iris-summary)
> 10 : term tex (label=xtable-demo)
> Loading required package: xtable
> 11 : echo term verbatim eps pdf (label=iris-pairs)
>
> Erreur :  chunk 11 (label=iris-pairs)
> Error in function (file = ifelse(onefile, "Rplots.pdf", "Rplot%03d.pdf"),  :
>  impossible de démarrer le périphérique pdf
> De plus : Messages d'avis :
> 1: In library(package, lib.loc = lib.loc, character.only = TRUE,
> logical.return = TRUE,  :
>  there is no package called 'xtable'
> 2: In function (file = ifelse(onefile, "Rplots.pdf", "Rplot%03d.pdf"),  :
>  impossible d'ouvrir le fichier en argument de 'pdf' 'Rplots.pdf'
> Exécution arrêtée
> Systemcall.cpp(270): Systemcall: 'Rscript --verbose --no-save --no-restore
> "/usr/local/share/lyx-2.0.3svn/scripts/lyxsweave.R"
> "/tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/""sweave.Rnw"
> "/tmp/lyx_tmpdir.T21839/lyx_tmpbuf2/""sweave.tex" ISO-8859-15
> "/usr/local/share/lyx-2.0.3svn/examples/"' finished with exit code 1
> Error: Conversion du fichier impossible
> 
>
> I installed R and related packages on my Debian box (Squeeze, R version
> 2.11). While updating fr.po for 2.0.3, I saw something about a requirement
> for R version >=2.14.
> Is that the reason of failure ?
>
> --
> Jean-Pierre
>


Re: Sweave manual pdf compilation fails

2012-02-01 Thread Liviu Andronic
On Wed, Feb 1, 2012 at 5:15 PM, Yihui Xie  wrote:
> I guess you compiled the document under
> /usr/local/share/lyx-2.0.3svn/examples/, right?
>
> I believe the problem is that R has no write privilege to that
> directory, so the default pdf() device cannot be started there. You
> can copy sweave.lyx to a directory where you have write privilege, and
> see if it compiles correctly.
>
Hmm, isn't the compilation supposed to be performed in a /tmp/ dir,
where permissions are available?

Liviu


Re: Sweave manual pdf compilation fails

2012-02-01 Thread Yihui Xie
You are right (ideally), but this is a long-lasting annoying problem
with R's default graphical device which is pdf() in the
non-interactive session. Unfortunately it has to create a file under
the current working directory (usually named Rplots.pdf). I requested
a true null device which does not write files, and it was implemented
in R 2.14.1, but again, unfortunately it has a bug which makes this
null device still write a file named NA. I have not got any response
from R core yet about this bug.

I can submit a simple patch to lyxsweave.R to avoid this problem by
redirecting the default file to a temp dir, but I'm not sure if it is
still in time. It should not break string freeze, though.

Regards,
Yihui
--
Yihui Xie 
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Wed, Feb 1, 2012 at 10:18 AM, Liviu Andronic  wrote:
> On Wed, Feb 1, 2012 at 5:15 PM, Yihui Xie  wrote:
>> I guess you compiled the document under
>> /usr/local/share/lyx-2.0.3svn/examples/, right?
>>
>> I believe the problem is that R has no write privilege to that
>> directory, so the default pdf() device cannot be started there. You
>> can copy sweave.lyx to a directory where you have write privilege, and
>> see if it compiles correctly.
>>
> Hmm, isn't the compilation supposed to be performed in a /tmp/ dir,
> where permissions are available?
>
> Liviu


Re: Sweave manual pdf compilation fails

2012-02-01 Thread Jean-Pierre Chrétien

Le 01/02/2012 17:15, Yihui Xie a écrit :

I guess you compiled the document under
/usr/local/share/lyx-2.0.3svn/examples/, right?

I believe the problem is that R has no write privilege to that
directory, so the default pdf() device cannot be started there. You
can copy sweave.lyx to a directory where you have write privilege, and
see if it compiles correctly.


Oops, stupid of me, sorry.

--
Jean-Pierre


Re: Sweave manual pdf compilation fails

2012-02-01 Thread Yihui Xie
No, I do not think that is your problem :) See my second reply above.

Regards,
Yihui
--
Yihui Xie 
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



2012/2/1 Jean-Pierre Chrétien :
> Le 01/02/2012 17:15, Yihui Xie a écrit :
>
>> I guess you compiled the document under
>> /usr/local/share/lyx-2.0.3svn/examples/, right?
>>
>> I believe the problem is that R has no write privilege to that
>> directory, so the default pdf() device cannot be started there. You
>> can copy sweave.lyx to a directory where you have write privilege, and
>> see if it compiles correctly.
>
>
> Oops, stupid of me, sorry.
>
> --
> Jean-Pierre


Re: Sweave manual pdf compilation fails

2012-02-01 Thread Jean-Pierre Chrétien

Le 01/02/2012 17:15, Yihui Xie a écrit :

I guess you compiled the document under
/usr/local/share/lyx-2.0.3svn/examples/, right?

I believe the problem is that R has no write privilege to that
directory, so the default pdf() device cannot be started there. You
can copy sweave.lyx to a directory where you have write privilege, and
see if it compiles correctly.


So I opened the example file in the compilation tree (which is under my personal 
account) and the error is gone, but now it does not find Sweave.sty.


The doc itself says it should, but unfortunately the Debian package puts the 
file in

/usr/share/R/texmf

instead of the documented

/usr/share/R/texmf/tex/latex

So I copied the file as

/usr/local/texlive/texmf-local/tex/latex/sweave/Sweave.sty

and ran texhash, and I get the pdf all right.

Seems thus that the manual does not compile out of the box on Debian Squeeze,
due to the path problem.

--
Jean-Pierre


Re: Sweave manual pdf compilation fails

2012-02-01 Thread Yihui Xie
That seems like a bug of Debian; R should be able to find Sweave.sty with

> file.path(R.home("share"), "texmf", "tex", "latex", "Sweave.sty")
[1] "/usr/share/R/share/texmf/tex/latex/Sweave.sty"

I'm using Ubuntu and R can find Sweave.sty correctly.

If possible, I strongly recommend you update R to the latest 2.14.1
(it is pretty easy to update if you set a CRAN mirror; see
instructions at http://cran.r-project.org/bin/linux/debian/). There
have been many changes in Sweave since 2.11.

Regards,
Yihui
--
Yihui Xie 
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



2012/2/1 Jean-Pierre Chrétien :
> Le 01/02/2012 17:15, Yihui Xie a écrit :
>>
>> I guess you compiled the document under
>>
>> /usr/local/share/lyx-2.0.3svn/examples/, right?
>>
>> I believe the problem is that R has no write privilege to that
>> directory, so the default pdf() device cannot be started there. You
>> can copy sweave.lyx to a directory where you have write privilege, and
>> see if it compiles correctly.
>
>
> So I opened the example file in the compilation tree (which is under my
> personal account) and the error is gone, but now it does not find
> Sweave.sty.
>
> The doc itself says it should, but unfortunately the Debian package puts the
> file in
>
> /usr/share/R/texmf
>
> instead of the documented
>
> /usr/share/R/texmf/tex/latex
>
> So I copied the file as
>
> /usr/local/texlive/texmf-local/tex/latex/sweave/Sweave.sty
>
> and ran texhash, and I get the pdf all right.
>
> Seems thus that the manual does not compile out of the box on Debian
> Squeeze,
> due to the path problem.
>
> --
> Jean-Pierre


Re: Sweave manual pdf compilation fails

2012-02-01 Thread Yihui Xie
I think so. If you add a CRAN mirror to your software repository,
Debian knows how to solve the dependencies. There is a Debian
maintainer who has been working on compiling R and some R packages to
Debian packages.

The versions of LyX and TeXLive often have a long time lag in
Debian/Ubuntu, but R gets updated pretty fast if you directly set a
CRAN mirror instead of waiting for other Debian repositories.

Regards,
Yihui
--
Yihui Xie 
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



2012/2/1 Jean-Pierre Chrétien :
> Le 01/02/2012 18:20, Yihui Xie a écrit :
>
>>
>> If possible, I strongly recommend you update R to the latest 2.14.1
>> (it is pretty easy to update if you set a CRAN mirror; see
>> instructions at http://cran.r-project.org/bin/linux/debian/). There
>> have been many changes in Sweave since 2.11.
>
>
> Sure, I can make a local install of R as I do for TeXLive and LyX, but will
> I get dependency problems with Debian packages ?
>
> --
> Jean-Pierre


Re: Sweave manual pdf compilation fails

2012-02-01 Thread Jean-Pierre Chrétien

Le 01/02/2012 18:20, Yihui Xie a écrit :


If possible, I strongly recommend you update R to the latest 2.14.1
(it is pretty easy to update if you set a CRAN mirror; see
instructions at http://cran.r-project.org/bin/linux/debian/). There
have been many changes in Sweave since 2.11.


Sure, I can make a local install of R as I do for TeXLive and LyX, but will I 
get dependency problems with Debian packages ?


--
Jean-Pierre


Re: Sweave manual pdf compilation fails

2012-02-01 Thread Liviu Andronic
On Wed, Feb 1, 2012 at 5:29 PM, Yihui Xie  wrote:
> You are right (ideally), but this is a long-lasting annoying problem
> with R's default graphical device which is pdf() in the
> non-interactive session. Unfortunately it has to create a file under
> the current working directory (usually named Rplots.pdf). I requested
> a true null device which does not write files, and it was implemented
> in R 2.14.1, but again, unfortunately it has a bug which makes this
> null device still write a file named NA. I have not got any response
> from R core yet about this bug.
>
> I can submit a simple patch to lyxsweave.R to avoid this problem by
> redirecting the default file to a temp dir, but I'm not sure if it is
> still in time. It should not break string freeze, though.
>
It would be nice, indeed. Richard, JMarc, can such a patch go in for 2.0.3?

Liviu


> Regards,
> Yihui
> --
> Yihui Xie 
> Phone: 515-294-2465 Web: http://yihui.name
> Department of Statistics, Iowa State University
> 2215 Snedecor Hall, Ames, IA
>
>
>
> On Wed, Feb 1, 2012 at 10:18 AM, Liviu Andronic  
> wrote:
>> On Wed, Feb 1, 2012 at 5:15 PM, Yihui Xie  wrote:
>>> I guess you compiled the document under
>>> /usr/local/share/lyx-2.0.3svn/examples/, right?
>>>
>>> I believe the problem is that R has no write privilege to that
>>> directory, so the default pdf() device cannot be started there. You
>>> can copy sweave.lyx to a directory where you have write privilege, and
>>> see if it compiles correctly.
>>>
>> Hmm, isn't the compilation supposed to be performed in a /tmp/ dir,
>> where permissions are available?
>>
>> Liviu



-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail


Re: Sweave manual pdf compilation fails

2012-02-01 Thread Yihui Xie
The patch is pretty simple: http://www.lyx.org/trac/ticket/8019

Regards,
Yihui
--
Yihui Xie 
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Wed, Feb 1, 2012 at 12:53 PM, Liviu Andronic  wrote:
> On Wed, Feb 1, 2012 at 5:29 PM, Yihui Xie  wrote:
>> You are right (ideally), but this is a long-lasting annoying problem
>> with R's default graphical device which is pdf() in the
>> non-interactive session. Unfortunately it has to create a file under
>> the current working directory (usually named Rplots.pdf). I requested
>> a true null device which does not write files, and it was implemented
>> in R 2.14.1, but again, unfortunately it has a bug which makes this
>> null device still write a file named NA. I have not got any response
>> from R core yet about this bug.
>>
>> I can submit a simple patch to lyxsweave.R to avoid this problem by
>> redirecting the default file to a temp dir, but I'm not sure if it is
>> still in time. It should not break string freeze, though.
>>
> It would be nice, indeed. Richard, JMarc, can such a patch go in for 2.0.3?
>
> Liviu
>
>
>> Regards,
>> Yihui
>> --
>> Yihui Xie 
>> Phone: 515-294-2465 Web: http://yihui.name
>> Department of Statistics, Iowa State University
>> 2215 Snedecor Hall, Ames, IA
>>


Re: Sweave manual pdf compilation fails

2012-02-01 Thread Jean-Marc Lasgouttes

Le 01/02/12 20:16, Yihui Xie a écrit :

The patch is pretty simple: http://www.lyx.org/trac/ticket/8019


It looks like a reasnable thing to do, if it does what I think it does. 
How confident are you with this patch? Does it rely only on documented 
behaviour, assumed to be present in earlier R versions? We do not want 
to force people to upgrade to latest R.


JMarc



Re: Sweave manual pdf compilation fails

2012-02-01 Thread Jean-Marc Lasgouttes

Le 01/02/12 18:20, Yihui Xie a écrit :

That seems like a bug of Debian; R should be able to find Sweave.sty with


file.path(R.home("share"), "texmf", "tex", "latex", "Sweave.sty")

[1] "/usr/share/R/share/texmf/tex/latex/Sweave.sty"

I'm using Ubuntu and R can find Sweave.sty correctly.

If possible, I strongly recommend you update R to the latest 2.14.1
(it is pretty easy to update if you set a CRAN mirror; see
instructions at http://cran.r-project.org/bin/linux/debian/). There
have been many changes in Sweave since 2.11.


It would be nice if we could find the file even in older versions of R. 
My policy is to do easy thing to support old versions, but not much more :)


JMarc



Re: Sweave manual pdf compilation fails

2012-02-01 Thread Yihui Xie
I'm pretty confident with this one. It does not have specific
requirements on R versions, and users do not have to upgrade R.

Regards,
Yihui
--
Yihui Xie 
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Wed, Feb 1, 2012 at 4:29 PM, Jean-Marc Lasgouttes  wrote:
> Le 01/02/12 20:16, Yihui Xie a écrit :
>
>> The patch is pretty simple: http://www.lyx.org/trac/ticket/8019
>
>
> It looks like a reasnable thing to do, if it does what I think it does. How
> confident are you with this patch? Does it rely only on documented
> behaviour, assumed to be present in earlier R versions? We do not want to
> force people to upgrade to latest R.
>
> JMarc
>


Re: Sweave manual pdf compilation fails

2012-02-01 Thread Yihui Xie
Yes, that would be ideal. I will update the patch to reflect this
issue. I do not remember in which version R moved Sweave.sty from
texmf to texmf/tex/latex, so let's search both places.

Regards,
Yihui
--
Yihui Xie 
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA



On Wed, Feb 1, 2012 at 4:38 PM, Jean-Marc Lasgouttes  wrote:
> Le 01/02/12 18:20, Yihui Xie a écrit :
>
>> That seems like a bug of Debian; R should be able to find Sweave.sty with
>>
>>> file.path(R.home("share"), "texmf", "tex", "latex", "Sweave.sty")
>>
>> [1] "/usr/share/R/share/texmf/tex/latex/Sweave.sty"
>>
>> I'm using Ubuntu and R can find Sweave.sty correctly.
>>
>> If possible, I strongly recommend you update R to the latest 2.14.1
>> (it is pretty easy to update if you set a CRAN mirror; see
>> instructions at http://cran.r-project.org/bin/linux/debian/). There
>> have been many changes in Sweave since 2.11.
>
>
> It would be nice if we could find the file even in older versions of R. My
> policy is to do easy thing to support old versions, but not much more :)
>
> JMarc
>