Skip to content

Commit

Permalink
fixed bug in parameter use and doc in label_outlier
Browse files Browse the repository at this point in the history
  • Loading branch information
abusjahn committed Nov 24, 2023
1 parent bfc18c1 commit 98c94f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion R/plots.R
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,9 @@ ggcormat <- function(cor_mat, p_mat = NULL,
#' @return A ggplot object, allowing further styling.
#'
# ' @examples
# todo: group by facet variables
#' @export
label_outliers <- function(plotbase, xvar, #yvar, labelvar,
label_outliers <- function(plotbase, labelvar, #xvar, #yvar,
coef=1.5, nudge_x=0, nudge_y=0,
color="darkred", size=3, hjust=0) {
if(!requireNamespace("ggrepel", quietly = TRUE)) {
Expand All @@ -253,6 +254,7 @@ label_outliers <- function(plotbase, xvar, #yvar, labelvar,
str_replace('^.+\\"(.+)\\".*',"\\1")
plotbase +
ggrepel::geom_text_repel(data=. %>%
# todo: group by facet variables
group_by(!!sym(xvar)) %>%
filter(!!sym(yvar) %in%
boxplot.stats(!!sym(yvar),
Expand Down
6 changes: 3 additions & 3 deletions man/label_outliers.Rd

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

0 comments on commit 98c94f0

Please sign in to comment.