R aggregate data.frame with date column

前端 未结 4 1134
挽巷
挽巷 2020-12-18 13:33

I have the data frame resambling the one in the below

Date       Expenditure Indicator
29-01-2011 5455        212
25-01-2012 5452        111
11-02-2011 365           


        
4条回答
  •  猫巷女王i
    2020-12-18 13:58

    Or use dplyr:

    library(dplyr)
    
    dta %>%
      group_by(Date) %>%
      summarise(Tot.Expenditure = sum(Expenditure))
    

提交回复
热议问题