Skip to content

Commit

Permalink
New argument vjust added #210
Browse files Browse the repository at this point in the history
  • Loading branch information
kassambara committed Apr 21, 2020
1 parent 7ee06c5 commit 0df7aee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
## Minor changes

- New arguments:
- `vjsut` in `stat_compare_means()` to move the text up or down relative to the bracket.
- `type` in `geom_bracket()` to specify label type. Can be "text" or "expression" (for parsing plotmath expression); [#253](https://github.com/kassambara/ggpubr/issues/253).
- `labeller` to the function `facet()`
- `position` in `get_legend()` to specify legend position
Expand Down
7 changes: 4 additions & 3 deletions R/stat_compare_means.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ NULL
#' allowed values include: i) one of c('right', 'left', 'center', 'centre',
#' 'middle') for x-axis; ii) and one of c( 'bottom', 'top', 'center', 'centre',
#' 'middle') for y-axis.}
#'@param vjust move the text up or down relative to the bracket.
#'@param tip.length numeric vector with the fraction of total height that the
#' bar goes down to indicate the precise column. Default is 0.03. Can be of
#' same length as the number of comparisons to adjust specifically the tip
Expand Down Expand Up @@ -100,7 +101,7 @@ stat_compare_means <- function(mapping = NULL, data = NULL,
method = NULL, paired = FALSE, method.args = list(), ref.group = NULL,
comparisons = NULL, hide.ns = FALSE, label.sep = ", ",
label = NULL, label.x.npc = "left", label.y.npc = "top",
label.x = NULL, label.y = NULL, tip.length = 0.03,
label.x = NULL, label.y = NULL, vjust = 0, tip.length = 0.03,
bracket.size = 0.3, step.increase = 0,
symnum.args = list(),
geom = "text", position = "identity", na.rm = FALSE, show.legend = NA,
Expand Down Expand Up @@ -144,7 +145,7 @@ stat_compare_means <- function(mapping = NULL, data = NULL,
test = method, test.args = method.args,
step_increase = step.increase, size = bracket.size, textsize = size, color = color,
map_signif_level = map_signif_level, tip_length = tip.length,
data = data)
data = data, vjust = vjust)
}

else{
Expand All @@ -157,7 +158,7 @@ stat_compare_means <- function(mapping = NULL, data = NULL,
method = method, method.args = method.args,
paired = paired, ref.group = ref.group,
symnum.args = symnum.args,
hide.ns = hide.ns, na.rm = na.rm, ...)
hide.ns = hide.ns, na.rm = na.rm, vjust = vjust,...)
)

}
Expand Down
3 changes: 3 additions & 0 deletions man/stat_compare_means.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0df7aee

Please sign in to comment.