SHARE
TWEET

Untitled

a guest Jun 19th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. df1:
  2. Date       Fruit  Num  Color
  3. 2013-11-24 Banana 2 Yellow
  4. 2013-11-24 Orange  8 Orange
  5. 2013-11-24 Apple   7 Green
  6. 2013-11-24 Celery 10 Green
  7.  
  8. df2:
  9. Date       Fruit  Num  Color
  10. 2013-11-24 Banana 22 Yellow
  11. 2013-11-24 Orange  8 Orange
  12. 2013-11-24 Apple   7 Green
  13. 2013-11-24 Celery 1 Green
  14.      
  15. library(dplyr)
  16. test <- rbind(df1, df2)
  17. test2 <- test %>%
  18.   group_by(Date) %>%
  19. summarise(max = max(.))
  20.      
  21. new.df:
  22. Date       Fruit  Num  Color
  23. 2013-11-24 Banana 22 Yellow
  24. 2013-11-24 Orange  8 Orange
  25. 2013-11-24 Apple   7 Green
  26. 2013-11-24 Celery 10 Green
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top