解决:Error: Discrete value supplied to continuous scale
目录
解决:Error: Discrete value supplied to continuous scale
#仿真数据
#install.packages("ggplot2")
# Install & load ggplot2 package
library("ggplot2")
data <- data.frame(x = 1:100,
# Create example data
y = c("0-10", "11-20", "21-30", "31+"))
head(data)
# Head of example data
#问题
ggplot(data, aes(x, y)) +
# Trying to set limits on y-axis
geom_point() &