I would like to plot pairwise inter-relationships between numerical data points in the style of a mixed circular scatterplot and a chord diagram.
In contrast to a "real" chord diagram, I only have a single sector with pairs of circular continuous values that represent different times of the day (0-24 h) that are assigned to different categorical groups:
> time1 <- c(4.85, 6.44, 15.45, 12.53, 5.24, 16.05)
> time2 <- c(16.78, 18.26, 5.94, 7.11, 15.45, 5.07)
> group <- c("A", "C", "D", "B", "A", "D")
> time_df <- cbind.data.frame(group, time1, time2)
> time_df
group time1 time2
1 A 4.85 16.78
2 C 6.44 18.26
3 D 15.45 5.94
4 B 12.53 7.11
5 A 5.24 15.45
6 D 16.05 5.07
There should be a line between each of these time points that is colored according to the group the pair is assigned to.
I tried using the chordDiagram()
function from the R package circlize
to realize this but soon noticed that it is mostly used for relationships between categorical data.
Do you know of another R package that could be used for this kind of visualization or can it be done using circlize::chordDiagram()
after all?