library(tidyverse)HDS 3.3-3.4
ggplot(
data = midwest,
mapping = aes(
x = popasian,
y = percollege,
color = state,
shape = state,
size = state
)
) +
geom_point() +
labs(
x = "Number of Asians",
y = "Percentage of College Educated (%)",
title = "Relationship between Number of Asians and Education Level",
color = "State",
shape = "State",
size = "State"
)Warning: Using size for a discrete variable is not advised.
ggplot(data = midwest,
aes(
x = percollege,
y = percbelowpoverty,
color = state)
) +
geom_boxplot() +
labs(
x = "Percentage of College Educated",
y = "Percentage Below Poverty",
title = "Education Level vs. Poverty Rate",
color = "State"
)Warning: Orientation is not uniquely specified when both the x and y aesthetics are
continuous. Picking default orientation 'x'.