Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.14 KB | None | 0 0
  1. x <- c(3,1,4,6,5,2,9,7,8,0)
  2.  
  3. mode(x)
  4.  
  5. Mode <- function(x) {
  6. ux <- unique(x)
  7. ux[which.max(tabulate(match(x, ux)))]
  8. }
  9.  
  10. Mode(x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement