Renaud Gaujoux
2011-Oct-28 14:49 UTC
[Rd] R CMD check and error in an \Sexpr in an Rd file
Hi, another Rd related issue I encountered is that if an error occurs in an \Sexpr in an Rd file, then on get the following error: * checking for portable compilation flags in Makevars ... OK * checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK * checking examples ... ERROR Error in paste(before, x, after, sep = "") : object 'exfile' not found Execution halted To reproduce, put a call like this in an Rd section: \Sexpr[results=verbatim, stage=render]{x <- 1; stop("sexpr error")} The strange thing is that it occurs at the example checking step. Not sure why it does not break before. Thank you. Renaud PS: I am on R version 2.13.2 (2011-09-30) - x86_64-pc-linux-gnu (64-bit) -- Renaud Gaujoux Computational Biology - University of Cape Town South Africa
Duncan Murdoch
2011-Oct-28 14:53 UTC
[Rd] R CMD check and error in an \Sexpr in an Rd file
On 28/10/2011 10:49 AM, Renaud Gaujoux wrote:> Hi, > > another Rd related issue I encountered is that if an error occurs in an > \Sexpr in an Rd file, then on get the following error: > > * checking for portable compilation flags in Makevars ... OK > * checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK > * checking examples ... ERROR > Error in paste(before, x, after, sep = "") : object 'exfile' not found > Execution halted > > To reproduce, put a call like this in an Rd section: > > \Sexpr[results=verbatim, stage=render]{x<- 1; stop("sexpr error")} > > The strange thing is that it occurs at the example checking step. > Not sure why it does not break before. > > Thank you. > > Renaud > > PS: I am on R version 2.13.2 (2011-09-30) - x86_64-pc-linux-gnu (64-bit) >I would update to 2.13.2 patched, or the release candidate of 2.14.0. Duncan Murdoch
Georgi Boshnakov
2011-Nov-01 11:36 UTC
[Rd] R CMD check and error in an \Sexpr in an Rd file
Dear Renaud,> Getting back to the \Sexpr issue, I tried with R-2.14.0 and I still see > the following issues: > > - verbatim multiline is not shown properly on PDF > (\Sexpr[results=verbatim, stage=render]{cat("line\nnext line")})You probably meant to use `paste', not `cat'. The latter sends its output somewhere and returns NULL, not the string. Best, Georgi -- Dr Georgi Boshnakov tel: (+44) (0)161 306 3684 School of Mathematics fax: (+44) (0)161 306 3669 Alan Turing Building 1.125 The University of Manchester email: Georgi.Boshnakov at manchester.ac.uk Oxford Road Manchester M13 9PL UK ------------------------------ Message: 18 Date: Tue, 01 Nov 2011 12:22:30 +0200 From: Renaud Gaujoux <renaud at mancala.cbio.uct.ac.za> To: Duncan Murdoch <murdoch.duncan at gmail.com> Cc: Renaud Gaujoux <renaud at mancala.cbio.uct.ac.za>, "r-devel at r-project.org" <r-devel at r-project.org> Subject: Re: [Rd] R CMD check and error in an \Sexpr in an Rd file Message-ID: <4EAFC866.6040803 at cbio.uct.ac.za> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Getting back to the \Sexpr issue, I tried with R-2.14.0 and I still see the following issues: - verbatim multiline is not shown properly on PDF (\Sexpr[results=verbatim, stage=render]{cat("line\nnext line")}) - verbatim with empty lines breaks PDF generation (\Sexpr[results=verbatim, stage=render]{cat("line\nnext line\n\nyet another line")}). Would there be an issue in using a plain Latex verbatim environment for \Sexpr[results=verbatim]? - an error in an \Sexpr (\Sexpr[results=verbatim, stage=render]{stop("error in sexpr")}) gives the following in R CMD check: * checking examples ... ERROR Error in paste(before, x, after, sep = "") : object 'exfile' not found Execution halted The two first issues can be reproduced with a call to R CMD Rd2pdf on the Rd code below. Thank you. Renaud. %%%%%%%%%%% \name{Sexpr} \alias{Sexpr} \title{Error and verbatim in Sexpr} \description{ Testing Sexpr in Rd files %\Sexpr[results=verbatim, stage=render]{stop("error in sexpr")} \Sexpr[results=verbatim, stage=render]{cat("line\nnext line")} %\Sexpr[results=verbatim, stage=render]{cat("line\nnext line\n\nyet another line")} } %%%%%%%%%%% -- Renaud Gaujoux Computational Biology - University of Cape Town South Africa On 28/10/2011 17:25, Duncan Murdoch wrote:> On 28/10/2011 10:53 AM, Duncan Murdoch wrote: >> On 28/10/2011 10:49 AM, Renaud Gaujoux wrote: >> > Hi, >> > >> > another Rd related issue I encountered is that if an error occurs >> in an >> > \Sexpr in an Rd file, then on get the following error: >> > >> > * checking for portable compilation flags in Makevars ... OK >> > * checking for portable use of $(BLAS_LIBS) and $(LAPACK_LIBS) ... OK >> > * checking examples ... ERROR >> > Error in paste(before, x, after, sep = "") : object 'exfile' not >> found >> > Execution halted >> > >> > To reproduce, put a call like this in an Rd section: >> > >> > \Sexpr[results=verbatim, stage=render]{x<- 1; stop("sexpr error")} >> > >> > The strange thing is that it occurs at the example checking step. >> > Not sure why it does not break before. >> > >> > Thank you. >> > >> > Renaud >> > >> > PS: I am on R version 2.13.2 (2011-09-30) - x86_64-pc-linux-gnu >> (64-bit) >> > >> >> I would update to 2.13.2 patched, or the release candidate of 2.14.0. > > Oops, sorry, 2.13.2 is "final", so I didn't backport the patch. > 2.14.0 is what you should get. > > Duncan Murdoch------------------------------ _______________________________________________ R-devel at r-project.org mailing list DIGESTED https://stat.ethz.ch/mailman/listinfo/r-devel End of R-devel Digest, Vol 105, Issue 1 ***************************************
Renaud Gaujoux
2011-Nov-03 11:58 UTC
[Rd] R CMD check and error in an \Sexpr in an Rd file
Georgi, I tried with paste() instead of cat(), but I then get the following in my PDF manual: [1] "line\nnext line" i.e. what would be printed in the R console, which is not what I want. I would like to get something like this in the Latex code: \begin{verbatim} line next line \end{verbatim} Using cat() I get the following in the Latex code: \AsIs{ line next line} which does not render as a new line in the PDF and breaks if empty lines are present in the output text. Besides it will also break on \Sexpr[results=verbatim, stage=render]{list("text", 3)}. But maybe this is not what 'results=verbatim' is supposed to do nor to be used for? Renaud Another test Rd file. %%%%%%%%% \name{Sexpr} \alias{Sexpr} \title{Error and verbatim in Sexpr} \description{ Testing Sexpr in Rd files %\Sexpr[results=verbatim, stage=render]{stop("error in sexpr")} Verbatim: 1: \Sexpr[results=verbatim, stage=render]{cat("line\nnext line\n")} 2: \Sexpr[results=verbatim, stage=render]{"line\nnext line\n"} 3: \Sexpr[results=verbatim, stage=render]{list("line\nnext line", 3)} Text: 1: \Sexpr[results=text, stage=render]{cat("line\nnext line\n")} 2: \Sexpr[results=text, stage=render]{"line\nnext line\n"} 3: \Sexpr[results=text, stage=render]{list("line\nnext line", 3)} } %%%%%