Skip to content

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

Closed
@paleolimbot

Description

@paleolimbot

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions