Advertisement
Guest User

Untitled

a guest
May 4th, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. library(MASS)
  2. library(ggplot2) # used for plotting, otherwise, it's optional
  3. Sigma <- matrix(c(10,3,3,2),2,2)
  4. var(mvrnorm(n = 1000, rep(0, 2), Sigma))
  5. example <- mvrnorm(n = 1000, rep(0, 2), Sigma)
  6.  
  7. examplePlot <- qplot(example[,1], example[,2]) +
  8. xlab(expression(x[1])) +
  9. ylab(expression(x[2]))
  10.  
  11. ggsave("examplePlot.jpg", examplePlot, width = 4, height = 4)
  12. write.csv(x = example, file = "example.csv", row.names = FALSE)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement