lattice包中的箱圖
bwplot(Species~Petal.Length,data=iris)
拓展:分位箱圖
library(Hmisc) bwplot(Species~Petal.Length,data=iris,panel=panel.bpplot,probs=seq(0.01,0.49,by=0.01),datadensity=T)
datadensity的作用是添加小提琴中的小豎線
probs的作用是更細化小提琴的外邊界
#將連續變量離散化 Sepal.Len=equal.count(na.omit(iris$Sepal.Length),number=4,overlap=1/5) stripplot(Species~Petal.Length|Sepal.Len,data=iris)