v0=sample(c(T,F),100,T)
df = data.frame(v0=v0, v1=rnorm(100,0,1) + v0*rnorm(100,1,1),v2=rnorm(100,2,1))
如何为每个变量(v0除外)制作一堆图,其中每个图都是密度图,如:
ggplot(df, aes(x=v1)) +
geom_density(aes(group=v0, colour=v0, fill=v0),
bw=.15,
alpha=0.3)