I am trying to create a chord graph using the circlize package in R. I would like to include sectors for which there is no outflow (no links emanating from them). Is there a way to:
Force the program to report rows from my data frame, even if there are only zeros in that row.
Suppress self-loops. (The vignettes calls on you to enter zeros at the diagonal to do this, but then we're back to the first problem.)
I have attached my code.
chordDiagram(mat, symmetric = TRUE, keep.diagonal = TRUE, order = union(rownames(mat), colnames(mat)),
directional = FALSE, annotationTrack = "grid", preAllocateTracks = list(
list(track.height = 0.05),
list(track.height = 0.05))
)
Here is some sample data.
a.1 a.2 a.3 a.4 a.5 a.6 a.7 a.8 a.9
a.1 1 0 0 0 1 0 0 0 0
a.2 0 1 0 0 0 0 0 1 0
a.3 0 0 1 0 0 0 0 0 0
a.4 0 0 0 1 0 0 0 0 0
a.5 1 0 0 0 1 0 0 0 0
a.6 0 0 0 0 0 1 0 0 1
a.7 0 0 0 0 0 0 1 0 1
a.8 0 1 0 0 0 0 0 1 1
a.9 0 0 0 0 0 1 1 1 1