Skip to content

Commit

Permalink
group argument added to geom_linerange #45
Browse files Browse the repository at this point in the history
  • Loading branch information
kassambara committed Oct 30, 2017
1 parent 5ede873 commit d452881
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions R/ggdotchart.R
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,16 @@ ggdotchart_core <- function(data, x, y, group = NULL,
...)
{
add <- match.arg(add)

if(!is.null(group)){
if(group == 1)
group <- NULL
}

if(is.null(group) & color[1] %in% names(data)){
group <- color[1]
}


.dots <- list(...)
sorting <- match.arg(sorting)
decreasing <- ifelse(sorting == "descending", FALSE, TRUE)
Expand Down Expand Up @@ -157,7 +161,7 @@ ggdotchart_core <- function(data, x, y, group = NULL,
size = size, position = position)

mapping <- seg.opts$mapping %>%
.add_item(x = x, ymin = 0, ymax = y)
.add_item(x = x, ymin = 0, ymax = y, group = group)
option <- seg.opts$option

# mapping <- seg.opts$mapping %>%
Expand Down

0 comments on commit d452881

Please sign in to comment.