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

Differences between plyr functions and functions in compat-plyr.R are causing failures #3315

Closed
paleolimbot opened this issue May 8, 2019 · 4 comments
Milestone

Comments

@paleolimbot
Copy link
Member

This is a revdep issue (#3303) in which the functions in compat-plyr.R are returning slightly different output than their former plyr counterparts, which in turn cause package failures.

  • Different output column ordering between plyr::ddply and ggplot2:::dapply results in a different order of evaluation, which causes random jitters to be slightly different between ggplot2 and ggstance (which is still using plyr). gstance tests for consistency between position_jitterdodge() and position_jitterdodgev(), which is why this results in a revdep failure.
df <- data.frame(y = 1:4, by_col = c("a", "b"))
plyr::ddply(df, "by_col", identity)
#>   y by_col
#> 1 1      a
#> 2 3      a
#> 3 2      b
#> 4 4      b
ggplot2:::dapply(df, "by_col", identity)
#>   by_col y
#> 1      a 1
#> 2      a 3
#> 3      b 2
#> 4      b 4
df <- data.frame(date = as.Date("2019-01-01"))
df_fct <- data.frame(date = as.factor(df$date))
unlist(ggplot2:::join_keys(df, df_fct, "date"))
#> x y n 
#> 1 1 1
unlist(ggplot2:::join_keys(df_fct, df, "date"))
#> x y n 
#> 2 1 2

unlist(plyr::join.keys(df, df_fct, "date"))
#> x y n 
#> 2 1 2
unlist(plyr::join.keys(df_fct, df, "date"))
#> x y n 
#> 1 1 1
@paleolimbot paleolimbot added this to the ggplot2 3.2.0 milestone May 8, 2019
@clauswilke
Copy link
Member

@thomasp85 Is it possible to rewrite the internal ggplot2 functions so they mirror the output from the plyr functions? If it's possible without too much effort then I think we should do it.

@thomasp85
Copy link
Member

It should be (and I thought it was before the revdepchecks)

@thomasp85
Copy link
Member

closed by #3327

@lock
Copy link

lock bot commented Nov 16, 2019

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Nov 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants