Skip to content

Instantly share code, notes, and snippets.

@benjic
Created July 15, 2012 14:53
Show Gist options
  • Save benjic/3117281 to your computer and use it in GitHub Desktop.
Save benjic/3117281 to your computer and use it in GitHub Desktop.
Random Normal Distribution
#First and foremost, we must have data. We see that there is a variable named RandomData and the asingment operation <- is assigning the value of rnorm(). rnorm(n) is a funciton which returns a vector of n values which lie within one standard deviation of the mean of 0.
RandomData <- rnorm(10000)
#hist displays a histogram of the vector of values.
hist(RandomData, col="blue")
#mean() computes the mean of the vector of values.
mean(RandomData)
#sd() computes the standard deviation of the vector of values.
sd(RandomData)
#summary() generates a table of all quartiles and max and min values.
summary(RandomData)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment