Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. x = c("a", "b", "c", "d")
  2. xx = sample(x, 1000, TRUE, prob =  c(0.15, 0.25, 0.40, 0.20))
  3.  
  4.  
  5. xxt = table(xx)
  6.  
  7. #View(xxt)
  8. pie(xxt)
  9.  
  10.  
  11. y = c(1, 2, 3, 4)
  12. yy = sample(y, 1000, TRUE, prob =  c(0.25, 0.15, 0.25, 0.35))
  13. yyt = table(yy)
  14.  
  15. #View(yyt)
  16. pie(yyt)
  17.  
  18. Z = rnorm(1000, 10, 2)
  19. View(Z)
  20. bk = (max(Z) - min(Z)) / 20
  21. Z_e = seq(min(Z), to = max(Z), by = bk)
  22. Z_e_T = table(cut(Z,19))
  23. View(Z_e_T)
  24.  
  25. Z_hist = hist(Z, Z_e)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement