Dear R users,
I am using "subset" function to filter out specific conditions and would
like to use the value of subsetted argument as a name of an object.
Specifically, from the following statement:
a <- subset(dat, dat$x == "A" & dat$xx == 1 & dat$xxx == "AB" & dat$y
== "B" & dat$yy == 2)
I would to assign the value of the 3rd subset argument (i.e. "AB") as an
object's name such as:
a.AB <- sum(a$z)
Appreciate for your valuable thoughts in advance.
Steve
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.