Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- df <-
- STUDY COV FLAG Freq
- 1 SEX 1 12
- 1 SEX 2 15
- 2 RACE 1 5
- 2 RACE 2 10
- 2 RACE 3 15
- dfout <-
- STUDY COV RATIO
- 1 SEX 12:15
- 2 RACE 5:10:15
- library(dplyr)
- dfout<- df%>%
- group_by(STUDY,COV) %>%
- summarise(RATIO=paste(Freq,":",lag(Freq)))
Add Comment
Please, Sign In to add comment