On Thu, Jul 16, 2009 at 4:44 PM, Erik Iverson wrote:
> I have a list of logical expressions, and I would really like it if the
> "names" of the components of the list were identical to the corresponding
> logical expression.
>
> So, as an example:
>
> df.example <- data.frame(a = 1:10, b = rnorm(
Try this:
> s <- c("df.example$a > 7", "df.example$b < 4")
> sapply(s, function(x) eval(parse(text = x)))
df.example$a > 7 df.example$b < 4
[1,]FALSE TRUE
[2,]FALSE TRUE
[3,]FALSEFALSE
[4,]FALSE
2 matches
Mail list logo