=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
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
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
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 =
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
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
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