Hi,
Is it possible in Sweave to put \Sexpr{} inside <<>>? This is a bad
example, but here goes:
<<results=hide>>
Age <- 5
@
<<>>
x <- \Sexpr{Age}
@
I'm trying to get it to display x <- 5, rather than x <- Age.
It's probably
so obvious I'm going to feel sorry for having to ask, just the same, I'm
stumped. Any ideas? Thanks.
--
View this message in context:
http://r.789695.n4.nabble.com/Sweave-Sexpr-inside-tp3237313p3237313.html
Sent from the R help mailing list archive at Nabble.com.
zerfetzen wrote:> > Is it possible in Sweave to put \Sexpr{} inside <<>>? This is a bad > example, but here goes: > > <<results=hide>> > Age <- 5 > @ > > <<>> > x <- \Sexpr{Age} > @ > ... >It's good to have a simplified example, but your's is so much simplified that it is difficult to understand. I know I had similar hen-and-egg problems before, so http://r-project.markmail.org/thread/xaflfjwt65dkgphi might guide you. If not, repost and make it clearer what the problem is. Dieter -- View this message in context: http://r.789695.n4.nabble.com/Sweave-Sexpr-inside-tp3237313p3237536.html Sent from the R help mailing list archive at Nabble.com.
On 11-01-25 8:22 PM, zerfetzen wrote:
>
> Hi,
> Is it possible in Sweave to put \Sexpr{} inside<<>>? This is
a bad
> example, but here goes:
>
> <<results=hide>>
> Age<- 5
> @
>
> <<>>
> x<- \Sexpr{Age}
> @
>
> I'm trying to get it to display x<- 5, rather than x<- Age.
It's
probably
> so obvious I'm going to feel sorry for having to ask, just the same,
I'm
> stumped. Any ideas? Thanks.
No, you can't do that. There are a couple of ways to do what you want.
Probably the easiest is to do what Sweave would do:
<<results=hide>>Age<- 5
@
\begin{Schunk}
\begin{Sinput}
> x<- \Sexpr{Age}
\end{Sinput}
\end{Schunk}
Duncan Murdoch