Re: [R] subset grouped data with quantile and NA's

2008-08-22 Thread jim holtman
This will also remove the NAs from the output; you will have to change it to also keep the NAs. Wasn't sure what you wanted to do with them. dat <- data.frame(fac = rep(c("a", "b"), each = 100), value = c(rnorm(130), rep(NA, 70)), other = rnorm(200)) # split the

[R] subset grouped data with quantile and NA's

2008-08-22 Thread David Carslaw
I can't quite seem to solve a problem subsetting a data frame. Here's a reproducible example. Given a data frame: dat <- data.frame(fac = rep(c("a", "b"), each = 100), value = c(rnorm(130), rep(NA, 70)), other = rnorm(200)) What I want is a new data frame (