R/plot_circos.R

Defines functions plot_circos

Documented in plot_circos

#' 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'))
}
thierrycnam/igfuns documentation built on May 4, 2020, 3:21 a.m.