A range of estimates of an unknown parameter
2023-04-14
A range of estimates of an unknown parameter
set.seed(923874) #Create data data <- round(data.frame(x= 1:10, y = runif(10, 10, 20), lower = runif(10, 0, 10), upper = runif(10, 20, 30)), 2) install.packages(“ggplot2”) #Install & load ggpot library(“ggplot2”)
ggplot(data, aes(x, y)) + #ggplot2 with confidence intervals geom_point() + geom_errorbar(aes(ymin = lower, ymax = upper))
set.seed(923874)
data <- round(data.frame(x= 1:10,
y = runif(10, 10, 20),
lower = runif(10, 0, 10),
upper = runif(10, 20, 30)), 2)
ggplot(data, aes(x, y)) +
geom_point() +
geom_errorbar(aes(ymin = lower, ymax = upper))
us_adults <- tibble(
climate_change_affects = c(rep("Yes", 62000), rep("No", 38000))
)
ggplot(us_adults, aes(x = climate_change_affects)) +
geom_bar(fill = 'blue') +
labs(
x = "", y = "",
title = "Do you think climate change is affecting your local community?"
) +
coord_flip()