Re: [R] Evaluate variable

2010-04-09 Thread Douglas Bates
You probably want to use substitute() to construct your formula and be careful of the distinction between character strings and names > substitute(foo ~ bar, list(foo = as.name("y"), bar = as.name("x"))) y ~ x On Fri, Apr 9, 2010 at 2:06 PM, Nic Rivers wrote: > Dear R-users: > > I would like to

[R] Evaluate variable

2010-04-09 Thread Nic Rivers
Dear R-users: I would like to create a system of regression equations of length n, where the variables are drawn from a data frame. The result I would like is given by the variable named "system" in the code below. However, when I use a loop to create the system of equations, I cannot s

Re: [R] evaluate variable within expression - how?

2010-02-14 Thread Jorge Ivan Velez
Hi Mark, Try also: plot(1:10) text(2, 5, "Some text", font = 2) HTH, Jorge On Sun, Feb 14, 2010 at 11:36 AM, Mark Heckmann <> wrote: > # I want to plot bold text. The text should depend on a variable > containing a character string. > > plot.new() > text(.5, .5, expression(bold("Some text"))

Re: [R] evaluate variable within expression - how?

2010-02-14 Thread Peter Ehlers
Try text(.5, .5, bquote(bold(.(myText -Peter Ehlers Mark Heckmann wrote: # I want to plot bold text. The text should depend on a variable containing a character string. plot.new() text(.5, .5, expression(bold("Some text"))) # now I would like to do the same replacing "some text" by a

Re: [R] evaluate variable within expression - how?

2010-02-14 Thread baptiste auguie
Hi, Try with bquote, plot.new() myText <- "some text" text(.5, .5, bquote(bold(.(myText basically, bquote( .(myText) ) performs the substitution before applying bold() (see ?bquote). HTH, baptiste On 14 February 2010 17:36, Mark Heckmann wrote: > #  I want to plot bold text. The text sh

[R] evaluate variable within expression - how?

2010-02-14 Thread Mark Heckmann
# I want to plot bold text. The text should depend on a variable containing a character string. plot.new() text(.5, .5, expression(bold("Some text"))) # now I would like to do the same replacing "some text" by a variable. plot.new() myText <- "some text" text(.5, .5, expression(bold(myText)))