Re: [R] R-ish challenge for dependent ranking

2008-08-25 Thread ivo welch
thank you everybody, again. regards, /iaw __ R-help@r-project.org 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, repr

Re: [R] R-ish challenge for dependent ranking

2008-08-25 Thread jim holtman
If you want to put it back in the original data frame: > ds= data.frame( xn=rnorm(32), yn=rnorm(32), zn=rnorm(32) ) > ds$drank1group= as.integer((rank( ds$xn )-1)/4) # ok, the first set > ds$drank2group <- ave(ds$yn, ds$drank1group, FUN=rank) > ds xn yn zn drank1grou

Re: [R] R-ish challenge for dependent ranking

2008-08-25 Thread baptiste auguie
Hi I think you want something like, with(ds, tapply(yn, drank1group, rank) ) also, the reshape package should do this sort of thing neatly. Hope this helps, baptiste On 25 Aug 2008, at 16:10, ivo welch wrote: Dear R wizards: First, thanks for the notes on SQL. These pointers will make

[R] R-ish challenge for dependent ranking

2008-08-25 Thread ivo welch
Dear R wizards: First, thanks for the notes on SQL. These pointers will make it a lot easier to deal with large data sets. Sorry to have a second short query the same day. I have been staring at this for a while, but I cannot figure out how to do a dependent ranking the R-sh way. ds= data.fra