EDA: Exploratory Data Analysis

Building a Visualization (some missing point)


Untitled


# simulate 10000 standard normal

Z <- rnorm(10000)
head(Z)

# plot a hist of Z w/ the true density overlayed on the plot

hist(Z, breaks = 30)

# create a normal curve
## need to consider the y-axis is FREQUENCY or DENSITY

z.plot <- seq(-5, 5, length = 10, probability = T)
plot(z.plot, dnorm(z.plot), col = "purple", lty = 1, lwd = 1)

# plot sin(x) cos(2x)+1 from -2pi,2pi in same graph
x.plot <- seq(-2*pi, 2*pi, length = 100)
plot(x.plot, sin(x.plot), col = "green", type = "l", ylim = c(-1.5, 2.5))
lines(x.plot, cos(x.plot*2)+1, col = "red", type = "l")

Wk4: Visualizations Cont. & ggplot