diff --git a/R/geom_scatterpie.R b/R/geom_scatterpie.R index 00ce2a0..3e038e5 100644 --- a/R/geom_scatterpie.R +++ b/R/geom_scatterpie.R @@ -13,8 +13,8 @@ ##' default is NULL, when it is provided, the ratio or value label will be displayed. ##' @param label_show_ratio logical only work when \code{label_radius} is not NULL, ##' default is TRUE, meaning the ratio of label will be displayed. -##' @param label_threshold numeric the threshold is to control display the label, the value or -##' ratio of label smaller than the threshold will not be displayed. default is 0. +##' @param label_threshold numeric the threshold is to control display the label, the ratio of +##' slice pie smaller than the threshold will not be displayed. default is 0. ##' @param donut_radius numeric the radius of donut chart (relative the radius of circle), default is NULL. ##' it should be between 0 and 1, if it is provided, the donut chart will be displayed instead of pie chart. ##' @param bg_circle_radius numeric the radius of background circle, default is FALSE, we suggest setting it diff --git a/R/utilities.R b/R/utilities.R index cec4495..6d81b69 100644 --- a/R/utilities.R +++ b/R/utilities.R @@ -77,7 +77,7 @@ is_fixed_radius <- function(rvar) { x[[".RATIO"]] <- round(x[[var]]/sum(x[[var]]), 2) x[[var]] <- round(x[[var]], 2) x[['.RATIO']] <- ifelse(x[['.RATIO']] < threshold, NA, x[[".RATIO"]]) - x[[var]] <- ifelse(x[[var]] < threshold, NA, x[[var]]) + x[[var]] <- ifelse(x[['.RATIO']] < threshold, NA, x[[var]]) x[['hjust']] <- ifelse(mid_angle > pi, 1, 0) x[['vjust']] <- ifelse(mid_angle < pi/2 | mid_angle > 3 * pi/2, 0, 1) x[['x']] <- rlabel * x[[r]] * sin(mid_angle) + x[['x']] diff --git a/man/geom_scatterpie.Rd b/man/geom_scatterpie.Rd index 9d3a53e..e263842 100644 --- a/man/geom_scatterpie.Rd +++ b/man/geom_scatterpie.Rd @@ -41,8 +41,8 @@ default is NULL, when it is provided, the ratio or value label will be displayed \item{label_show_ratio}{logical only work when \code{label_radius} is not NULL, default is TRUE, meaning the ratio of label will be displayed.} -\item{label_threshold}{numeric the threshold is to control display the label, the value or -ratio of label smaller than the threshold will not be displayed. default is 0.} +\item{label_threshold}{numeric the threshold is to control display the label, the ratio of +slice pie smaller than the threshold will not be displayed. default is 0.} \item{donut_radius}{numeric the radius of donut chart (relative the radius of circle), default is NULL. it should be between 0 and 1, if it is provided, the donut chart will be displayed instead of pie chart.}