Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. X = c("a","b","c","d")
  2. prob = c(0.15,0.25,0.4,0.2)
  3. XX = sample(x = X,size = 1000,replace = TRUE,prob = prob)
  4.  
  5. XXT = table(XX)
  6.  
  7.  
  8. pdf(file = "XXP.pdf")
  9. pie(XXT)
  10. dev.off()
  11.  
  12. ytable = table(ysample)
  13. barplot(ytable)
  14. help(rnorm)
  15.  
  16. Z = rnorm(1000,mean = 10, sd = 2 )
  17. help(seq)
  18.  
  19. Z_e = seq(min(Z)-0.1, max(Z)+1, 1)
  20. Z_table = table(cut(Z,Z_e))
  21. help(hist)
  22. hist(Z,Z_e)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement