Dear R members,

I have this data frame of 100 years in the following format

year            month       day         A           B           C         D

where  A,B,C and D are item number sold each day. I am trying 

1-split the data w.r.t the monthly values for each year

2-then, sum them up

I am pasting here just a part of data to make it more clearer

structure(list(year = c(1961, 1961, 1961, 1961, 1961, 1961, 1961, 
1961, 1961, 1961, 1961, 1961), month = c(1, 1, 1, 1, 1, 1, 1, 
1, 1, 1, 1, 1), day = 1:12, A = 1:12, B = 3:14, C = 6:17, D = 16:27), .Names = 
c("year", 
"month", "day", "A", "B", "C", "D"), row.names = c(NA, 12L), class = 
"data.frame")

I initially tried to use "dcast" command but for no use.

Your kind help is needed.

Thanks in advance

Eliza


                                          
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to