我有一个矩阵,里面有一排排的基因,以及它们在某些疾病类别中有多少种药物.
我试着用R做一个和弦图,把我所有的疾病分成几个部分,然后每种疾病有多少个基因有药物,哪些有重叠.
然而,使用我的矩阵,当我try 运行chordDiagram(df)
时,我得到了一个和弦图,其中不仅有疾病的部分,还有基因的部分.
我的数据片段如下所示:
df <- structure(c(0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, 0, 2,
0, 8, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0,
0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1), .Dim = c(5L,
11L), .Dimnames = list(c("CASZ1", "CASQ2", "VANGL1", "CLCN6",
"MTHFR"), c("heart failure", "cardiomyopathy", "coronary artery disease",
"cardiovascular disease", "hypertension", "atrial fibrillation",
"arrhythmia", "myocardial infarction", "cardiac arrest", "heart valve disease",
"Other conditions")))
如何才能得到部分仅为疾病/我的列名的弦图?