Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. x <- data.frame("SN" = 1:7, "Age" = c(21,15,22,33,21,15,25), "Name" = c("John","Dora","Paul","Alex","Bud","Chad","Anton"))
  2.  
  3. x[order(x[, 'Age']),]
  4.  
  5. SN Age Name
  6. 2 2 15 Dora
  7. 6 6 15 Chad
  8. 1 1 21 John
  9. 5 5 21 Bud
  10. 3 3 22 Paul
  11. 7 7 25 Anton
  12. 4 4 33 Alex
  13.  
  14. SN Age Name
  15. 6 6 15 Chad
  16. 2 2 15 Dora
  17. 5 5 21 Bud
  18. 1 1 21 John
  19. 3 3 22 Paul
  20. 7 7 25 Anton
  21. 4 4 33 Alex
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement