Basically I have a data frame with 1000 00 rows and although I’m sure what I’m trying to achieve is quite strait forward I can’t get my head around it or I might just not describing what I need to google properly. I’ve tried do this in excel using some complex index, match formulas but excel can’t cope once I expand the formula to all the cells.
So here is an example of my dataframe:
tag<-c("B11","B11","B10","C17","C16","C16")
year<-c("2010","2010","2010","2011","2011","2011")
month<-c("Jan","Jan","May","Feb","Aug","Aug")
area<- c("north","south","south","west","north","west")
sightings<-c(2,4,3,2,1,6)
tagdata<-data.frame(tag,year,month,area,sightings,stringsAsFactors=FALSE)
What I'm expecting is to be able to delete the “area” column and aggregate all equal rows and sum the “sightings” column. The expected result should be as follows:
Thank you all in advance.