Skip to content

about data manipulation

1 message · Jim Lemon

#
Hi lily,
If you want to use aggregate, supply the name of the function:

aggregate(flow~year, data=df, "sum")

You can also use "by" like this

by(df$flow,df$year,FUN=sum)

I assume that you don't have to worry about missing months in a year.

Jim
:
On Thu, Dec 1, 2016 at 3:06 PM, lily li <chocold12 at gmail.com> wrote: