How to create a circular multi-histogram graph using the R package circlize?

213 Views Asked by At

I apologize in advance since I am a beginner user in R.

I have a big data file, with multiple factors (15), and multiple tested samples from various group within each factor (5). I have calculated the means for each group within each factor. To simplify the presentation of my data, I would like to create a circular plot to present this information. I came upon the package 'circilize' and the 'circos.trackHist()' is a perfect choice for my purposes. Unfortunately, the guide I am looking at does not provide an example of how to use imported data, but rather creates simulated data from scratch. In addition, it is rather complex for my level and I would appreciate any support with graphing it. If I have the following data in tabular form in excel, how could I create a circular plot?

║ Factor ║ group ║ average ║ ║ Factor1 ║ A ║ 77.53 ║ ║ Factor1 ║ B ║ 54.98 ║ ║ Factor1 ║ B ║ 43.35 ║ ║ Factor1 ║ C ║ 243.0 ║ ║ Factor2 ║ A ║ 91.3 ║ ║ Factor2 ║ A ║ 70.2 ║ ║ Factor2 ║ A ║ 67.93 ║ ║ Factor3 ║ C ║ 16.49 ║ ║ Factor3 ║ B ║ 0 ║ ║ Factor3 ║ C ║ 5.1416 ║

1

There are 1 best solutions below

0
On

Seems like you need to create a matrix. Use the factors as your rows and groups as your columns and write a loop to load the values into the matrix. Might have to do it in data frame and convert to matrix, but it shouldn't be too hard.