Re: [R] Finding Sum

2014-10-24 Thread Jeff Newmiller
Please post in plain text to avoid corruption of your message. Your data has duplicates in it... I don't get the numbers you provided, even if I remove the duplicates. See table(dta$Year,dta$Month) There are many ways to do this kind of calculation. One is to use the base R function aggregate(

[R] Finding Sum

2014-10-24 Thread Hafizuddin Arshad
Hi, I really need help on this. I have this data set: structure(list(Year = c(1971L, 1971L, 1971L, 1971L, 1971L, 1971L, 1971L, 1971L, 1971L, 1972L, 1972L, 1972L, 1972L, 1972L, 1972L, 1973L, 1973L, 1973L, 1973L, 1973L, 1973L, 1973L, 1973L, 1973L, 1973L, 1974L, 1974L, 1974L, 1974L, 1974L, 1974L, 19