立即学习:https://edu.csdn.net/course/play/24913/285842?utm_source=blogtoedu
nqr<-rep("年轻人",4)
znr<-rep("中年人",5)
lnr<-rep("老年人",6)
age<-c(nqr,znr,lnr)
age
height<-sample(160:185,15,replace=TRUE)
height
weight<-sample(40:90,15,replace=TRUE)
weight
df<-data.frame(age,height,weight)
df
coplot(height~weight|age,col='red')
#coplot函数
当有三、四个变量时,coplot函数可以将散点图画的更细。
假设,a和b是数值向量,c是因子或向量(所有变量具有想等的长度。)
coplot(a~b|c)
在给定c值下,a关于b的散点图。