#' Plot circos
#'
#' Plot circos plot given two categorical factors
#'
#' @param df_ data frame
#' @param factor_1 factor variable 1
#' @param factor_2 factor variable 2
#' @param colors_ Custom colors theme
#'
#' @return
#' @export
#'
#' @examples
plot_circos <- function(df_, factor_1, factor_2, colors_) {
tb_circlize <-
df_ %>%
group_by(!!sym(factor_1), !!sym(factor_2)) %>%
count()
tb_circlize
chordDiagram(tb_circlize,
transparency = 0.75,
annotationTrack = c('name', 'grid'))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.