library(gapminder)
gapminder_07 <- filter(.data = gapminder, year == 2007)
p_hist <- ggplot(data = gapminder_07, mapping = aes(x = lifeExp)) +
geom_histogram(binwidth = 2)
p_box <- ggplot(data = gapminder_07, mapping = aes(x = continent, y = lifeExp)) +
geom_boxplot()
p_scatter <- ggplot(data = gapminder_07, mapping = aes(x = gdpPercap, y = lifeExp)) +
geom_point()
p_text <- gapminder_07 |>
filter(continent == "Americas") |>
ggplot(mapping = aes(x = gdpPercap, y = lifeExp)) +
geom_text_repel(mapping = aes(label = country)) +
coord_cartesian(clip = "off")













