Q:

function return multiple values r

aggregate(cbind(a,b) ~ year, data = y, sum)
#  year  a  b
#1 2007 10  5
#2 2008 13  6
#3 2009 21 12
#4 2010 19 11
0

New to Communities?

Join the community