From 7182c39469134325618015daf07e7b0f4b4c049d Mon Sep 17 00:00:00 2001 From: Jianfeng Li Date: Fri, 14 May 2021 16:02:29 +0800 Subject: [PATCH 1/2] add ellipse_col param --- R/flowerplot.R | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/R/flowerplot.R b/R/flowerplot.R index 20e351e..5e64c13 100644 --- a/R/flowerplot.R +++ b/R/flowerplot.R @@ -29,6 +29,7 @@ #' flowerplot(flower_dat, angle = 60, ellipse_col_pal = "Set3") flowerplot <- function(data, angle = 90, a = 1, b = 2, r = 1, + ellipse_col = NULL, ellipse_col_pal = "Set1", circle_col = "white", label_text_cex = 1) @@ -53,8 +54,10 @@ flowerplot <- function(data, angle = 90, # set the angle of degress deg <- 360 / n # set the ellipse filling color - colors <- RColorBrewer::brewer.pal(8, ellipse_col_pal) - ellipse_col <- grDevices::colorRampPalette(colors)(n) + if (is.null(ellipse_col)) { + colors <- RColorBrewer::brewer.pal(8, ellipse_col_pal) + ellipse_col <- grDevices::colorRampPalette(colors)(n) + } res <- lapply(1:n, function(t){ plotrix::draw.ellipse(x = 5 + cos((angle + deg * (t - 1)) * pi / 180), From d603e850fff32a69b1606f2ecd8d41839ebe9c90 Mon Sep 17 00:00:00 2001 From: Jianfeng Li Date: Thu, 27 May 2021 23:25:15 +0800 Subject: [PATCH 2/2] fix data param --- DESCRIPTION | 2 +- R/flowerplot.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 68114a7..ea5ab87 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: flowerplot Title: Flower Plot -Version: 0.1.0 +Version: 0.1.1 Author: Wei Dong Maintainer: Wei Dong Description: This Package Is Used To Draw Flower Plot With Multiple Data Sets. diff --git a/R/flowerplot.R b/R/flowerplot.R index 5e64c13..8d02693 100644 --- a/R/flowerplot.R +++ b/R/flowerplot.R @@ -27,7 +27,7 @@ #' circle_col = "red", ellipse_col_pal = "Spectral", #' label_text_cex = 1.5) #' flowerplot(flower_dat, angle = 60, ellipse_col_pal = "Set3") -flowerplot <- function(data, angle = 90, +flowerplot <- function(flower_dat, angle = 90, a = 1, b = 2, r = 1, ellipse_col = NULL, ellipse_col_pal = "Set1",