我正在处理汇总董事会成员(主题)成员特征的数据。这些人受过教育和性爱。
当绘制该图时,它应显示服务时间(段的长度),其中一名成员暂时从其在董事会中的位置被撤职了一段时间。该细分受众群在两个服务条款之间都应有间隔。但是它显示了由段链接的期间。
我尝试添加geom_path
,甚至通过创建新的白色等段类型来强制出现白色间隙,但是感觉太过强制了。如果没有,我将需要出示
library(ggplot2)
data<-data.frame(subject=c("A","B","C","A","D","A","B","C","A","D"))
data$education<-c("HS","PhD","BA","HS","BA","HS","PhD","BA","HS","BA")
data$date<-c("1/1/2000","1/1/2000","1/1/2000","4/1/2000","1/1/2000",
"2/28/2000","12/31/2000","12/31/2000","12/31/2000","12/31/2000")
data$sex<-c("M","F","M","M","F","M","F","M","M","F")
data$date<-as.Date(data$date,"%m/%d/%Y")
ggplot(data,aes(x=date,y=
(subject),shape=sex,group=education,color=education))+
geom_point(size=4)+ theme_classic()+
theme(axis.text.x = element_text(angle = 90, hjust = 1))+
geom_line(aes(group=subject),size=1)
我希望得到A的细分,该细分在不活动日期之间有间隔。