Hello everyone, I hope you are very well.
I am trying to create a chord diagram similar to the one below.
But I'm not sure if with the data I have it is possible to create it.
The three categorical variables in my study are July, August and September. Those in the example are lake and river. I want my chord diagram to assign my microorganisms to each month, some months lack microorganisms, others don't, and that's what I try to do.
This is my data
library(circlize)
#> Warning: package 'circlize' was built under R version 4.1.3
#> ========================================
#> circlize version 0.4.14
#> CRAN page: https://cran.r-project.org/package=circlize
#> Github page: https://github.com/jokergoo/circlize
#> Documentation: https://jokergoo.github.io/circlize_book/book/
#>
#> If you use it in published research, please cite:
#> Gu, Z. circlize implements and enhances circular visualization
#> in R. Bioinformatics 2014.
#>
#> This message can be suppressed by:
#> suppressPackageStartupMessages(library(circlize))
#> ========================================
data <- tibble::tribble(
~Genero, ~July, ~August, ~September,
"Cellvibrio", 0.023505755, 0.011622155, 0.013200682,
"Flavobacterium", 0.038155599, 0.033594784, 0.029099624,
"Pseudomonas", 0.092512525, 0.083497242, 0.092737283,
"Acinetobacter", 0, 0.011078402, 0,
"Aeromonas", 0, 0.012375054, 0,
"Rhizobium", 0.011394596, 0, 0.019735154,
"Mycobacterium", 0.010815652, 0.010919349, 0.011306759,
"Rhodococcus..high.GC.Gram..", 0.012300145, 0.014767685, 0.014064412,
"Nocardioides", 0.010593385, 0.011974449, 0,
"Streptomyces", 0.051174555, 0.05541951, 0.053165967,
"Acidovorax", 0.02964213, 0.029351938, 0.035976529,
"Microbacterium", 0.0194295, 0.02006355, 0.017048469,
"Stenotrophomonas", 0.014097439, 0.016655954, 0.013967263,
"Brevundimonas", 0.019045535, 0.018808073, 0.018279987,
"Hydrogenophaga", 0.016997829, 0.018172307, 0.01901446,
"Rheinheimera", 0.018825301, 0.012823078, 0,
"Mycolicibacterium", 0.015140394, 0.015890419, 0.013954585,
"Agrobacterium", 0, 0, 0.010974386,
"Devosia", 0, 0, 0.013137156
)
chordDiagram(data)
#> There are more than one numeric columns in the data frame. Take the
#> first two numeric columns and draw the link ends with unequal width.
#>
#> Type `circos.par$message = FALSE` to suppress the message.
circos.clear()
Created on 2022-03-31 by the reprex package (v2.0.1)
Thank you in advance.