# Group by year # Load dataframe dates.rda with number and dates # The dataframe is called dates with the variables Nu (number) and FU (date) # To show the data frame: dates # Calculate the year for each date and add to the dataframe: dates$Year<-strftime(dates$FU,"%Y") # Now aggregate and all this dates.agg: dates.agg<-aggregate(Nu~Year,dates,FUN=length) # To show a table with the number per year: dates.agg # And plot a bar chart: dev.new() ggplot() + geom_bar(aes(x = Year,y = Nu),data=dates.agg,colour = '#009933',fill = '#00cc33',stat = 'identity') + theme_bw() + ylab(label = 'Number')