Skip to content

Performing stats on group of observations

3 messages · Ion Mateescu, Erin Hodgess, Bert Gunter

#
"... trying to figure it out" ??

Not sure what that means.Have you read "An Introduction to R."? If
not, do so now.

In any case, ?ave is made for what you want, I think (simpler than
?by). As in (if df is your data frame):

ave(df$NoFlights,df$Week, FUN= mean)

Or, better yet, using ?with and noting that mean is the default for FUN

with(df,ave(NoFlights,Week))

Cheers,
Bert
On Mon, Jun 24, 2013 at 4:53 PM, Ion Mateescu <ion.matees at gmail.com> wrote: