Skip to content
Prev 166804 / 398503 Next

indexing question

have a look at ?"[.data.frame"; what you need is the following:

dat <- data.frame(a = rbinom(20, 1, 0.5), x = rnorm(20), y = rnorm(20))

dat
dat[dat$a == 1, ]


I hope it helps.

Best,
Dimitris
Bunny, lautloscrew.com wrote: