In the following code, r studio is saying that it cannot find a function for ggplot.
Is there any way to fix this?
p <- 0.15
n <- 100
data1 <- rnorm(n=n, mean=p, sd=sqrt(p*(1-p)/n))
data <- as.data.frame(data1)
ggplot(data, aes(x = data1)) +
geom_histogram(color = "white") +
xlim(0, 0.3) +
labs(y ="Count", x = "p-hats", title="n=100")