我的數據由多個類別(在本例中爲三個類別)的測試對象組成,但這些類別基於三個時間點:基因型,早期表型和晚期表型階段。創建一個包含三列的轉換圖
這裏是樣本數據:
genotype<-cbind(c(rep("A",100),rep("B",100),rep("C",100)))
early_phenotype<-cbind(c(rep("A",75),rep("B",75),rep("C",75),rep("A",75)))
late_phenotype<-cbind(c(rep("A",50),rep("B",100),rep("C",100),rep("A",50)))
df<-cbind(genotype,early_phenotype,late_phenotype)
df<-as.data.frame(df)
colnames(df)<-c("genotype","early_phenotype","late_phenotype")
我想生產什麼通常稱爲一個「過渡的情節」。我已經得到了最接近的是這樣的:
library(Gmisc)
transitionPlot(table(df[,1:2]), txt_start_clr = "black", txt_end_clr = "black", fill_start_box = "white", fill_end_box = "white")
但我想實現兩件事情,這個陰謀沒有:
有什麼建議?
P.S.我並不在乎箱子的彎曲邊緣,也不在乎幻想的陰影。
使用[Gmisc :: Transition-class](https://cran.r-project.org/web/packages/Gmisc/vignettes/Transition-class.html)可能會出現超過2列 –