Skip to content

Instantly share code, notes, and snippets.

@benjic
benjic / RandomDistrobution.R
Created July 15, 2012 14:53
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.