geom_col()
和geom_bar()
比较参考 Strayer (2019)
Whereas
geom_col()
expects you to pass it a y-axis mapping column,geom_bar()
doesn’t take a y-axis call (at least by default). DataCamp
# geom_col()
data %>%
groupby(xAxisCol) %>%
summarize(value = n()) %>%
ggplot(aes(x = xAxisCol, y = value) +
geom_col()
# geom_bar()
data %>%
ggplot(aes(x = xAxisCol)) +
geom_bar()