Skip to content
Prev 325895 / 398503 Next

Performing stats on group of observations

"... 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: