Timeline for Sum a variable based on another variable
Current License: CC BY-SA 4.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 27, 2019 at 13:20 | vote | accept | Emil Nyboe Blicher | ||
Feb 27, 2019 at 10:46 | comment | added | Sonny |
As @Sotos suggested, you should create another grouping variable and then use group_by and summarise from dplyr package
|
|
Feb 27, 2019 at 10:41 | comment | added | Emil Nyboe Blicher | @Sotos But I want to be able to specifically write something like "2017M01":"2017M06". | |
Feb 27, 2019 at 10:38 | history | reopened | Sotos r Users with the r badge or a synonym can single-handedly close r questions as duplicates and reopen them as needed. | ||
Feb 27, 2019 at 10:38 | answer | added | Sotos | timeline score: 1 | |
Feb 27, 2019 at 10:37 | history | closed | www r Users with the r badge or a synonym can single-handedly close r questions as duplicates and reopen them as needed. | Duplicate of How to sum a variable by group | |
Feb 27, 2019 at 10:36 | history | edited | Emil Nyboe Blicher | CC BY-SA 4.0 |
Elaboration
|
Feb 27, 2019 at 10:35 | comment | added | Sotos |
Just create a grouping variable for every 6 rows. Something like rep(seq(nrow(df)%/%6), each = 6)
|
|
Feb 27, 2019 at 10:33 | history | asked | Emil Nyboe Blicher | CC BY-SA 4.0 |