解决问题:Error: geom_point requires the following missing aesthetics: y Run `rlang::last_error()` to see where the error occurred.
目录
#仿真数据
library("ggplot2")
data <- data.frame(col1 = 1:10,
col2 = 20:11)
data
#问题
ggplot(data, aes(x = col1)) +
# Only one variable specified
geom_point()
> ggplot(data, aes(x = col1)) + # Only