0

I have a data set DATA with column REF_AREA, TIME_PERIOD, ROW_ID, X I want to sum by REF_AREA and TIME_PERIOD When I do this

 DATA %>%
 group_by(REF_AREA,TIME_PERIOD) %>%
 summarise(X_ = sum(X))

I got his as a result, so not by REF_AREA TIME_PERIOD

     X_
1 72147423

I looked on the stackoverflow and tried many ways found here, but not the result expected yet.

IceCreamToucan
  • 28,083
  • 2
  • 22
  • 38
IRT
  • 209
  • 2
  • 11
  • 3
    Please give a [mre] in your question! – jogo Sep 11 '19 at 13:41
  • 2
    Maybe that is because `plyr` is loaded after `dplyr`. See difference in `mtcars %>% group_by(cyl) %>% dplyr::summarise(mpg = sum(mpg))` and `mtcars %>% group_by(cyl) %>% plyr::summarise(mpg = sum(mpg))` – Ronak Shah Sep 11 '19 at 13:52
  • Comment from Ronak solved it – IRT Sep 11 '19 at 14:17

0 Answers0