[R] Evaluating expresssions as parameter values

Deepayan Sarkar deepayan.sarkar at gmail.com
Wed Sep 30 13:20:35 CEST 2009


On Tue, Sep 22, 2009 at 12:03 PM, Erich Neuwirth
<erich.neuwirth at univie.ac.at> wrote:
> I need to play games with an expression similar to the following one:
>
> print(xyplot(DepVar ~ Group|Covar, groups=Othergroup,
>        data=mydf, pch = 18 ,main="Testcase",auto.key = TRUE))
>
>
> The problem is that  the formula argument (the first argument)
> an the groups argument are passed over from another program as strings.
>
> The formula argument does not pose problems,
> I can do as.formula("DepVar ~ Group|Covar")
> bit I could not find an equivalent technique for the groups parameter.


'groups' can be a formula too, e.g.,

xyplot(Sepal.Length ~ Petal.Length, iris, groups = ~Species)

-Deepayan




More information about the R-help mailing list