Is there any way to have Sexpr span multiple lines? -- David ? ----------------------------------------------------- David Huffer, Ph.D. Senior Statistician CSOSA/Washington, DC david.huffer at csosa.gov -----------------------------------------------------
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 embedded newline should work. For example, <<echo=FALSE>>string <- "this goes on \\\\\\\\\n two lines" @ \Sexpr{string} (I think you really need all those escapes to get two backslashes in the output!) I don't know if it will happen for 2.10.x, but I would like to extend \Sexpr to be just as flexible as the <<>>= notation, by putting the Sweave options in a Latex-like option: \Sexpr[fig=true]{ plot(rnorm(1000))} You can do this now in R-devel in the new Sweave-like syntax in Rd files (except they don't support figs yet), but not yet in the original. Duncan Murdoch
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: http://www.nabble.com/Sweave%3A-multiline-Sexpr--tp24275448p24276023.html Sent from the R help mailing list archive at Nabble.com.
Maybe Matching Threads
- Sweave \Sexpr{} advice please
- Sweave processes \Sexpr in commented LaTeX source (2.3.1patched and 2.4.0)
- Sweave processes \Sexpr in commented LaTeX source (2.3.1patched and 2.4.0)
- Sweave: \Sexpr{} inside <<>>?
- Sweave processes \Sexpr in commented LaTeX source