# All functions in this script are Core R (no package needed).

# Example - Random Sample from a N(0,1) Distribution
########################################################################################

set.seed(3)   # Same random numbers as in the book

random_sample <- rnorm(n = 25, mean = 0, sd = 1)
random_sample


# Example - set.seed() Gives the Same "Random" Numbers Every Time
########################################################################################

set.seed(1)
random_sample <- rnorm(n = 5, mean = 0, sd = 1)
random_sample  # vector of random selections from a N(0,1) distribution


# Example - Plotting a Random Sample
########################################################################################

# Plotting a random sample using the Core R hist() function
random_sample <- rnorm(n = 50, mean = 0, sd = 1)
hist(random_sample, breaks = 16 , xlab = 'Sampled Values', ylab = 'Frequency')
