[R] Putting splom in a function

Roberto Perdisci roberto.perdisci at gmail.com
Thu Feb 15 16:37:32 CET 2007


On 2/15/07, Deepayan Sarkar <deepayan.sarkar at gmail.com> wrote:
> On 2/14/07, Roberto Perdisci <roberto.perdisci at gmail.com> wrote:
>
> > if I use
> >               groups = groups
> > instead of
> >               groups = as.symbol(groups)
> >
> > shomthing is plotted, but not the correct scatterplot.
>
> Try groups = eval(as.name(groups))

groups = eval(as.name(groups))  does exactly what I was looking for :)
and then I noticed that groups = eval(as.symbol(groups)) works as well

thank you,
Roberto

> Deepayan
>
> > I think the problem is that I don't cast the 'groups' variable to the
> > correct type. Besides as.symbol() I tried also as.expression(),
> > because ?xyplot says "groups: a variable or expression to be evaluated
> > in the data frame specified by 'data'".
> > What is the correct type? What as.* should I use?
> >
> > thank you,
> > regards,
> > Roberto
> >
> > ______________________________________________
> > R-help at stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
>



More information about the R-help mailing list