set.seed(123)
library(data.table)
library(ggplot2)
dat=data.table(data.frame(a=rnorm(12),b=rnorm(12),c=rep(c(1,2),6),d=rep(c(1,2,3,4),3)))
ggplot(dat,aes(a,c,colour=d)) + geom_point() # line 1
ggplot(dat,aes(a,c,shape=d)) + geom_point() # line 2
为什么第1行可以工作,而第2行不能?难道这只是图形外观的区别吗?
谢谢
cut
函数。 - cbeleites unhappy with SX