Re: [R] Sweave - if \Sexpr{} than \SweaveInput{my.Rnw}

2012-09-20 Thread Duncan Murdoch
On 20/09/2012 8:47 AM, Witold E Wolski wrote: Depending on an R computation I would like to include an Sweave documents in the main Sweave document. How can I do it? So I was thinking to use Latex features : \newif\ifpaper \ifpaper \SweaveInput{my1.Rnw} \else \SweaveInput{my2.Rnw} \fi

Re: [R] Sweave - if \Sexpr{} than \SweaveInput{my.Rnw}

2012-09-20 Thread Yihui Xie
If you want to program Sweave documents, you can try the knitr package. This case will be something like: = paper - TRUE # or change it to FALSE @ child=if (paper) 'my1.Rnw' else 'my2.Rnw'= @ i.e. you use the logical variable 'paper' to control which child document to include in the parent

Re: [R] Sweave - if \Sexpr{} than \SweaveInput{my.Rnw}

2012-09-20 Thread Duncan Murdoch
On 20/09/2012 9:05 AM, Duncan Murdoch wrote: On 20/09/2012 8:47 AM, Witold E Wolski wrote: Depending on an R computation I would like to include an Sweave documents in the main Sweave document. How can I do it? So I was thinking to use Latex features : \newif\ifpaper \ifpaper

Re: [R] Sweave - have Sexpr print 3 digits when the last is 0

2010-01-30 Thread Jorge Ivan Velez
Hi Elizabeth, Try using sprintf (?sprintf) instead of round(). HTH, Jorge On Sat, Jan 30, 2010 at 5:50 PM, Elizabeth Stanny wrote: Hi, I want 3 digits printed even if the last one is zero with \Sexpr{} For example: ghg.06[12] [1] 0.2501008 I want: 0.250 What I've tried:

Re: [R] Sweave: multiline Sexpr?

2009-06-30 Thread Duncan Murdoch
On 30/06/2009 12:44 PM, David Huffer wrote: Is there any way to have Sexpr span multiple lines? For input or output? I.e. do you want \Sexpr{x + y} or do you want the value to display on multiple lines? I think you can't do the first. To do the second, returning a character value with an

Re: [R] Sweave: multiline Sexpr?

2009-06-30 Thread Dieter Menne
HufferD wrote: Is there any way to have Sexpr span multiple lines? Use an R block to create the output as as string, and Sexpr that one. It's anyway much more readable than to hide complex calculations in the latex part. Dieter -- View this message in context:

Re: [R] Sweave: multiline Sexpr?

2009-06-30 Thread David Huffer
like the way to go, but it seems not to take full advantage of the language. Thank you both. David -Original Message- From: Duncan Murdoch [mailto:murd...@stats.uwo.ca] Sent: Tuesday, June 30, 2009 1:16 PM To: David Huffer Cc: r-help@r-project.org Subject: Re: [R] Sweave: multiline

Re: [R] Sweave and \Sexpr{}

2009-02-05 Thread Dieter Menne
Felipe Carrillo mazatlanmexico at yahoo.com writes: I am trying to create a dynamic latex table using \Sexpr{} but it's not evaluating it. I also tried the example below without Sweave and also fails. I have also copied the Sweave.sty to my working directory but nothing seems to work. Do I

Re: [R] Sweave and \Sexpr{}

2009-02-05 Thread Eric R.
Felipe: See Leisch's FAQ A18. http://www.statistik.lmu.de/~leisch/Sweave/FAQ.html#x1-2A.18 You likely have R2HTML loaded (likely because you are using Tinn-R) and that causes some difficulties for Sweave that are easily solved as described in the FAQ. Felipe Carrillo wrote: Hi: I

Re: [R] Sweave and \Sexpr{}

2009-02-05 Thread Felipe Carrillo
. --- On Thu, 2/5/09, Eric R. er...@mcs.st-and.ac.uk wrote: From: Eric R. er...@mcs.st-and.ac.uk Subject: Re: [R] Sweave and \Sexpr{} To: r-help@r-project.org Date: Thursday, February 5, 2009, 1:03 AM Felipe: See Leisch's FAQ A18. http://www.statistik.lmu.de/~leisch/Sweave/FAQ.html#x1-2A.18

Re: [R] Sweave and \Sexpr{}

2009-02-05 Thread Dieter Menne
Felipe Carrillo mazatlanmexico at yahoo.com writes: It is working now although I still have to specify the path to Sweave.sty \usepackage{C:/R/R-2.8.1/share/texmf/Sweave} and it doesn't evaluate \Sexpr{} when I simply use \usepackage{Sweave}. I placed Sweave.sty in the same folder where my rnw