我正在阅读https://r4ds.had.co.nz/data-visualisation.html。练习3.6.1。要求创建这个
我尝试了fill = drv
library(tidyverse)
ggplot(mpg, aes(x = displ, y = hwy)) +
geom_point(shape = 21, colour = "white", fill = drv, size = 5, stroke = 5)
和fill = factor(drv)
ggplot(mpg, aes(x = displ, y = hwy)) +
geom_point(shape = 21, colour = "white", fill = factor(drv), size = 5, stroke = 5)
并得到错误
找不到对象“ drv”