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

na.rm appears not to propagate to the transform in stat_dots #51

Closed
gdbassett opened this issue Jan 20, 2021 · 3 comments
Closed

na.rm appears not to propagate to the transform in stat_dots #51

gdbassett opened this issue Jan 20, 2021 · 3 comments

Comments

@gdbassett
Copy link

chunk %>%
    filter(!is.na(tdiff)) %>%
    mutate(tdiff = if_else(tdiff == 0, 1, tdiff)) %>%
  ggplot() + 
    ggdist::stat_dots(aes(x=tdiff, y=0), quantiles=100,
                      na.rm=TRUE
    ) +
    scale_x_log10() +
    NULL

results in the error:

Warning message in self$trans$transform(x):
“NaNs produced”
Warning message:
“Transformation introduced infinite values in continuous x-axis”

It appears as if the na.rm=TRUE is not getting correctly propagated to the transform. The error doesn't occur when either quantiles is not set or scale_x_log10() is not used.

@gdbassett
Copy link
Author

I've found I also run into what appears to be a similar issue setting limits on the x scale:

Warning message:
“Computation failed in `stat_dots()`:
missing values and NaN's not allowed if 'na.rm' is FALSE”
Warning message in rep(yes, length.out = len):
“'x' is NULL so the result will be NULL”
ERROR while rich displaying an object: Error in ans[ypos] <- rep(yes, length.out = len)[ypos]: replacement has length zero

@mjskay mjskay closed this as completed in 2ba44c4 Jun 11, 2021
@mjskay
Copy link
Owner

mjskay commented Jun 11, 2021

@gdbassett this should be fixed now (sadly not on the cran version; I didn't get to it in time, but will be in the next release!)

thanks again for all the feedback!

@gdbassett
Copy link
Author

You're welcome. Thank you for fixing it!

Gabe

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