Re: [R] Subsampling-oversampling from a data frame

2011-11-01 Thread B77S
# Perhaps I misunderstand your original need, but ## I added a few lines to your data and used dput() to get the below data (I named "df") df<- structure(list(age = c(15L, 20L, 15L, 10L, 10L, 12L, 17L, 17L, 11L, 12L, 16L, 20L, 23L, 14L, 22L, 16L, 10L, 11L, 21L, 10L, 13L, 17L), sex = struct

Re: [R] Subsampling-oversampling from a data frame

2011-11-01 Thread B77S
If no one has a better solution, split it, take a sample of size X from both and put it back together. hgwelec wrote: > > Dear members, > > Consider the following data frame (first 4 rows shown) > > > age sex class > 15 m low > 20 f high > 15 f low > 10 m low > > in