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

yticks.by only works without NAs #89

Closed
j3ypi opened this issue Jun 6, 2018 · 0 comments
Closed

yticks.by only works without NAs #89

j3ypi opened this issue Jun 6, 2018 · 0 comments

Comments

@j3ypi
Copy link

j3ypi commented Jun 6, 2018

The yticks.by argument of ggpar() only works without NAs. There is an easy fix for this, since the error message says

Error in seq.default(0, max(y), by = yticks.by) : 
  'to' must be a finite number

max(y) needs to be changed to max(y, na.rm = T) and the problem is solved.

Here's a reproducable example

library(tidyverse)
library(ggpubr)

df1 <- tibble(
  sum1 = c(NA, round(runif(49, 0, 10), 0)),
  condition = rep(c("A", "B"), each = 25)
)

a <- ggbarplot(df1, 
           x = "condition",
           y = "sum1",
           add = "mean_se", 
           ylim = c(0, 10))

ggpar(a, 
  yticks.by = 2)

Unfortunatly I don't have much time at the moment. I will probably get to fix this and issue #71 in september, but until then just write

ggbarplot(na.omit(df1), 
           x = "condition",
           y = "sum1",
           add = "mean_se", 
           ylim = c(0, 10))

instead. Maybe someone else has time to fix it in the meantime.

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