Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange behaviour when faceting #192

Closed
stevedempseybis opened this issue Jun 28, 2019 · 2 comments
Closed

Strange behaviour when faceting #192

stevedempseybis opened this issue Jun 28, 2019 · 2 comments

Comments

@stevedempseybis
Copy link

This code

library(tidyverse)
library(ggpubr)
mtcars %>% 
  gather(var,value) %>% 
  ggpubr::gghistogram('value',facet.by = 'var',scales='free_x',add='mean')

leads to this strange result:
bad_graph

It can be remedied by replacing var withvari. This leads to the expected outcome:
graph

@kassambara
Copy link
Owner

gghistogram computes internally some descriptive statistics before adding the mean line. These descriptive stats include mean, iqr, sd, var, cv, median, se.

Using any of these key words as x variable, will give the same behavior when add = "mean" or add = "median".

We'll fix this

kassambara added a commit that referenced this issue Jun 28, 2019
@kassambara
Copy link
Owner

fixed now thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants