Re: [R] creating a quantile variable based on subsets of a dataframe

2013-08-06 Thread David Winsemius
On Aug 6, 2013, at 10:17 AM, Gavin Rudge wrote: > #some sample data: > library(Hmisc) > set.seed(33) > df<-data.frame(x=(sample(letters[1:10],1000,replace=TRUE)),y=rnorm(1000,mean=20,sd=15)) > > x is a category from a to J, say a geographical area, into which an > observation y falls, y being a

[R] creating a quantile variable based on subsets of a dataframe

2013-08-06 Thread Gavin Rudge
#some sample data: library(Hmisc) set.seed(33) df<-data.frame(x=(sample(letters[1:10],1000,replace=TRUE)),y=rnorm(1000,mean=20,sd=15)) x is a category from a to J, say a geographical area, into which an observation y falls, y being a score. Now if I want to put my score into quantiles (quintile