Re: [R] Calculation of group summaries

2005-07-15 Thread Søren Højsgaard
=dietox12, FUN=c(mean,myvar)) Søren -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] På vegne af Gabor Grothendieck Sendt: 15. juli 2005 04:43 Til: [EMAIL PROTECTED] Cc: R-Help Emne: Re: [R] Calculation of group summaries 1. Try using more spaces so your code

Re: [R] Calculation of group summaries

2005-07-14 Thread Seeliger . Curt
Several people suggested specific functions (by, tapply, sapply and others); thanks for not blowing off a simple question regarding how to do the following SQL in R: select year, site_id, visit_no, mean(undercut) AS meanUndercut, count(undercut) AS

Re: [R] Calculation of group summaries

2005-07-14 Thread Gabor Grothendieck
1. Try using more spaces so your code is easier to read. 2. Use data.frame to define your data frame (since the method in your post creates data frames of factors rather than the desired classes). 3. Given the appropriate function, f, a single 'by' statement rbind'ed together, as shown, will

Re: [R] Calculation of group summaries

2005-07-14 Thread Gabor Grothendieck
There was an error in my code (after advising you to use data.frame rather than cbind I used it myself!). Here it is again: nsites - 6 yearList - 1999:2001 fakesub - data.frame( year = rep(yearList, nsites/length(yearList), each = 11), site_id = rep(c('site1','site2'), each =

[R] Calculation of group summaries

2005-07-12 Thread Seeliger . Curt
I know R has a steep learning curve, but from where I stand the slope looks like a sheer cliff. I'm pawing through the available docs and have come across examples which come close to what I want but are proving difficult for me to modify for my use. Calculating simple group means is fairly

Re: [R] Calculation of group summaries

2005-07-12 Thread Francisco J. Zagmutt
Take a look at ?aggregate ?ave and ?tapply Cheers Francisco From: [EMAIL PROTECTED] To: R-Help r-help@stat.math.ethz.ch Subject: [R] Calculation of group summaries Date: Tue, 12 Jul 2005 10:51:03 -0700 I know R has a steep learning curve, but from where I stand the slope looks like a sheer

Re: [R] Calculation of group summaries

2005-07-12 Thread Frank E Harrell Jr
See http://biostat.mc.vanderbilt.edu/twiki/bin/view/Main/SasByMeansExample for one example. Frank [EMAIL PROTECTED] wrote: I know R has a steep learning curve, but from where I stand the slope looks like a sheer cliff. I'm pawing through the available docs and have come across examples