Binary files /tmp/tmpYiv8a8/N2lthkHrFV/r-cran-afex-0.25-1/build/partial.rdb and /tmp/tmpYiv8a8/0lIVTBHzWY/r-cran-afex-0.26-0/build/partial.rdb differ Binary files /tmp/tmpYiv8a8/N2lthkHrFV/r-cran-afex-0.25-1/build/vignette.rds and /tmp/tmpYiv8a8/0lIVTBHzWY/r-cran-afex-0.26-0/build/vignette.rds differ diff -Nru r-cran-afex-0.25-1/debian/changelog r-cran-afex-0.26-0/debian/changelog --- r-cran-afex-0.25-1/debian/changelog 2019-09-09 11:30:03.000000000 +0000 +++ r-cran-afex-0.26-0/debian/changelog 2020-01-22 20:34:35.000000000 +0000 @@ -1,3 +1,13 @@ +r-cran-afex (0.26-0-1) unstable; urgency=medium + + * Team upload. + * New upstream version + * Standards-Version: 4.5.0 (routine-update) + * Set upstream metadata fields: Archive, Bug-Database, Bug-Submit, + Repository, Repository-Browse. + + -- Andreas Tille Wed, 22 Jan 2020 21:34:35 +0100 + r-cran-afex (0.25-1-1) unstable; urgency=medium * Team upload. diff -Nru r-cran-afex-0.25-1/debian/control r-cran-afex-0.26-0/debian/control --- r-cran-afex-0.25-1/debian/control 2019-09-09 11:30:03.000000000 +0000 +++ r-cran-afex-0.26-0/debian/control 2020-01-22 20:34:35.000000000 +0000 @@ -12,7 +12,7 @@ r-cran-lmertest, r-cran-car, r-cran-reshape2 -Standards-Version: 4.4.0 +Standards-Version: 4.4.1 Vcs-Browser: https://salsa.debian.org/r-pkg-team/r-cran-afex Vcs-Git: https://salsa.debian.org/r-pkg-team/r-cran-afex.git Homepage: https://cran.r-project.org/package=afex diff -Nru r-cran-afex-0.25-1/debian/upstream/metadata r-cran-afex-0.26-0/debian/upstream/metadata --- r-cran-afex-0.25-1/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ r-cran-afex-0.26-0/debian/upstream/metadata 2020-01-22 20:34:35.000000000 +0000 @@ -0,0 +1,5 @@ +Archive: CRAN +Bug-Database: https://github.com/singmann/afex/issues +Bug-Submit: https://github.com/singmann/afex/issues/new +Repository: https://github.com/singmann/afex.git +Repository-Browse: https://github.com/singmann/afex diff -Nru r-cran-afex-0.25-1/DESCRIPTION r-cran-afex-0.26-0/DESCRIPTION --- r-cran-afex-0.25-1/DESCRIPTION 2019-08-27 18:10:02.000000000 +0000 +++ r-cran-afex-0.26-0/DESCRIPTION 2020-01-16 05:40:03.000000000 +0000 @@ -5,7 +5,7 @@ Suggests: emmeans (>= 1.4), coin, xtable, parallel, plyr, optimx, nloptr, knitr, rmarkdown, R.rsp, lattice, latticeExtra, multcomp, testthat, mlmRev, dplyr, tidyr, dfoptim, Matrix, - psych, ggplot2, MEMSS, effects, carData, ggbeeswarm, nlme, + psychTools, ggplot2, MEMSS, effects, carData, ggbeeswarm, nlme, cowplot, jtools, ggpubr, ggpol, MASS, glmmTMB, brms, rstanarm Imports: pbkrtest (>= 0.4-1), lmerTest (>= 3.0-0), car, reshape2, stats, methods, utils @@ -27,7 +27,7 @@ Encoding: UTF-8 VignetteBuilder: knitr, R.rsp Authors@R: c(person(given="Henrik", family="Singmann", role=c("aut", "cre"), - email="singmann+afex@gmail.com", comment=c(ORCID="0000-0002-4842-3657")), + email="singmann@gmail.com", comment=c(ORCID="0000-0002-4842-3657")), person(given="Ben", family="Bolker", role=c("aut")), person(given="Jake",family="Westfall", role=c("aut")), person(given="Frederik", family="Aust", role=c("aut"), @@ -40,11 +40,11 @@ person(given="Jonathon", family="Love", role=c("ctb")), person(given="Russell", family="Lenth", role=c("ctb")), person(given="Rune", family="Haubo Bojesen Christensen", role=c("ctb"))) -Version: 0.25-1 -RoxygenNote: 6.1.1 +Version: 0.26-0 +RoxygenNote: 7.0.2 LazyData: true NeedsCompilation: no -Packaged: 2019-08-27 16:58:58 UTC; henrik +Packaged: 2020-01-15 21:03:10 UTC; henrik Author: Henrik Singmann [aut, cre] (), Ben Bolker [aut], Jake Westfall [aut], @@ -57,6 +57,6 @@ Jonathon Love [ctb], Russell Lenth [ctb], Rune Haubo Bojesen Christensen [ctb] -Maintainer: Henrik Singmann +Maintainer: Henrik Singmann Repository: CRAN -Date/Publication: 2019-08-27 18:10:02 UTC +Date/Publication: 2020-01-16 05:40:03 UTC diff -Nru r-cran-afex-0.25-1/inst/doc/afex_anova_example.html r-cran-afex-0.26-0/inst/doc/afex_anova_example.html --- r-cran-afex-0.25-1/inst/doc/afex_anova_example.html 2019-08-27 16:58:23.000000000 +0000 +++ r-cran-afex-0.26-0/inst/doc/afex_anova_example.html 2020-01-15 21:02:37.000000000 +0000 @@ -1,11 +1,10 @@ - + - @@ -13,7 +12,7 @@ - + ANOVA and Post-Hoc Contrasts: Reanalysis of Singmann and Klauer (2011) @@ -96,7 +95,7 @@

ANOVA and Post-Hoc Contrasts: Reanalysis of Singmann and Klauer (2011)

Henrik Singmann

-

2019-08-27

+

2020-01-15

@@ -298,8 +297,8 @@

Alternatively, the anova method for afex_aov objects returns a data.frame of class anova that can be passed to, for example, xtable for nice formatting:

print(xtable::xtable(anova(a1), digits = c(rep(2, 5), 3, 4)), type = "html")
- - + +
@@ -523,12 +522,12 @@ ## ## Linear Hypotheses: ## Estimate Std. Error t value Pr(>|t|) -## MP - MT == 0 10.831 4.331 2.501 0.05921 . -## MP - AC == 0 18.100 5.018 3.607 0.00468 ** +## MP - MT == 0 10.831 4.331 2.501 0.05915 . +## MP - AC == 0 18.100 5.018 3.607 0.00443 ** ## MP - DA == 0 4.556 4.196 1.086 0.31350 -## MT - AC == 0 7.269 3.984 1.825 0.19426 +## MT - AC == 0 7.269 3.984 1.825 0.19409 ## MT - DA == 0 -6.275 4.703 -1.334 0.31350 -## AC - DA == 0 -13.544 5.299 -2.556 0.05921 . +## AC - DA == 0 -13.544 5.299 -2.556 0.05915 . ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ## (Adjusted p values reported -- free method) @@ -818,14 +817,14 @@ ## ## Linear Hypotheses: ## Estimate Std. Error t value Pr(>|t|) -## diff_1 == 0 4.175 1.641 2.543 0.0650 . -## diff_2 == 0 34.925 7.082 4.931 8.34e-05 *** -## diff_3 == 0 -23.600 9.830 -2.401 0.0705 . +## diff_1 == 0 4.175 1.641 2.543 0.0651 . +## diff_2 == 0 34.925 7.082 4.931 8.08e-05 *** +## diff_3 == 0 -23.600 9.830 -2.401 0.0709 . ## diff_4 == 0 -8.100 11.275 -0.718 0.6882 -## val_ded == 0 35.800 7.096 5.045 5.76e-05 *** +## val_ded == 0 35.800 7.096 5.045 6.08e-05 *** ## val_prob == 0 0.400 7.096 0.056 0.9553 ## plau_ded == 0 -3.275 3.065 -1.068 0.6036 -## plau_prob == 0 30.775 4.992 6.164 1.73e-06 *** +## plau_prob == 0 30.775 4.992 6.164 2.38e-06 *** ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ## (Adjusted p values reported -- free method) @@ -837,14 +836,14 @@ ## ## Linear Hypotheses: ## Estimate Std. Error t value Pr(>|t|) -## diff_1 == 0 -22.425 8.742 -2.565 0.080883 . -## diff_2 == 0 -2.700 8.987 -0.300 0.984914 -## diff_3 == 0 -0.925 7.522 -0.123 0.984914 -## diff_4 == 0 -3.650 9.358 -0.390 0.984914 -## val_ded == 0 -11.412 6.651 -1.716 0.379258 -## val_prob == 0 -1.137 6.651 -0.171 0.984914 -## plau_ded == 0 -4.562 4.115 -1.109 0.725822 -## plau_prob == 0 13.363 2.957 4.519 0.000409 *** +## diff_1 == 0 -22.425 8.742 -2.565 0.081066 . +## diff_2 == 0 -2.700 8.987 -0.300 0.984919 +## diff_3 == 0 -0.925 7.522 -0.123 0.984919 +## diff_4 == 0 -3.650 9.358 -0.390 0.984919 +## val_ded == 0 -11.412 6.651 -1.716 0.379647 +## val_prob == 0 -1.137 6.651 -0.171 0.984919 +## plau_ded == 0 -4.562 4.115 -1.109 0.725912 +## plau_prob == 0 13.363 2.957 4.519 0.000404 *** ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ## (Adjusted p values reported -- free method) diff -Nru r-cran-afex-0.25-1/inst/doc/afex_mixed_example.html r-cran-afex-0.26-0/inst/doc/afex_mixed_example.html --- r-cran-afex-0.25-1/inst/doc/afex_mixed_example.html 2019-08-27 16:58:26.000000000 +0000 +++ r-cran-afex-0.26-0/inst/doc/afex_mixed_example.html 2020-01-15 21:02:40.000000000 +0000 @@ -1,11 +1,10 @@ - + - @@ -13,7 +12,7 @@ - + Mixed Model Reanalysis of RT data @@ -96,7 +95,7 @@

Mixed Model Reanalysis of RT data

Henrik Singmann

-

2019-08-27

+

2020-01-15

@@ -208,7 +207,7 @@ panel.points(tmp$x, tmp$y, pch = 13, cex =1.5) }) + bwplot(mean ~ density:frequency|task+stimulus, agg_p, pch="|", do.out = FALSE)
-

+

Now we plot the same data but aggregated across items:

agg_i <- fhch %>% group_by(item, task, stimulus, density, frequency) %>%
   summarise(mean = mean(log_rt)) %>%
@@ -221,7 +220,7 @@
          panel.points(tmp$x, tmp$y, pch = 13, cex =1.5)
        }) + 
 bwplot(mean ~ density:frequency|task+stimulus, agg_i, pch="|", do.out = FALSE)
-

+

These two plots show a very similar pattern and suggest several things:

  • Responses to nonwords appear slower than responses to words, at least for the naming task.
  • @@ -483,6 +482,7 @@ ## low - high nonword lexdec 0.1105 0.0164 Inf 6.719 <.0001 ## ## Results are averaged over the levels of: density +## Degrees-of-freedom method: asymptotic ## P value adjustment: holm method for 4 tests

    We could also use a slightly more powerful method than the Holm method, method free from package multcomp, which takes the correlation of the model parameters into account (note that due a bug in the current emmenas version this is currently deactivated):

    summary(as.glht(update(pairs(emm_i1), by = NULL)), test = adjusted("free"))
    @@ -501,6 +501,7 @@ ## high,nonword,lexdec effect 1.085 1.03 Inf 2.384 0.0228 ## ## Results are averaged over the levels of: density +## Degrees-of-freedom method: asymptotic ## P value adjustment: fdr method for 8 tests
    @@ -563,6 +564,7 @@ ## ll_hl nonword lexdec -0.11852 0.0209 Inf -5.670 <.0001 ## lh_hh nonword lexdec -0.00164 0.0198 Inf -0.083 1.0000 ## +## Degrees-of-freedom method: asymptotic ## P value adjustment: holm method for 8 tests

    In contrast to our expectation, the results show two significant effects and not only one. In line with our expectations, in the nonword and lexdec condition the EMM of low:high is smaller than the EMM for high:high, \(z = -6.30\), \(p < .0001\). However, in the nonword and naming condition we found the opposite pattern; the EMM of low:high is larger than the EMM for high:high, \(z = 3.65\), \(p = .002\). For all other effects \(|z| < 1.3\), \(p > .99\). In addition, there is no difference between low:high and high:high in any condition.

    diff -Nru r-cran-afex-0.25-1/inst/doc/afex_plot_introduction.html r-cran-afex-0.26-0/inst/doc/afex_plot_introduction.html --- r-cran-afex-0.25-1/inst/doc/afex_plot_introduction.html 2019-08-27 16:58:47.000000000 +0000 +++ r-cran-afex-0.26-0/inst/doc/afex_plot_introduction.html 2020-01-15 21:03:00.000000000 +0000 @@ -1,11 +1,10 @@ - + - @@ -13,7 +12,7 @@ - + afex_plot: Publication Ready Plots for Experimental Designs @@ -96,7 +95,7 @@

    afex_plot: Publication Ready Plots for Experimental Designs

    Henrik Singmann

    -

    2019-08-27

    +

    2020-01-15

    @@ -171,12 +170,20 @@

    Exploring Graphical Options and Themes

    -

    We now produce a new variant of the left plot using more appropriate error bars and change several other graphical details which make the plot publication ready. We use the ability of afex_plot() to rename the factor levels (for technical reasons the ANOVA functions in afex transform all factor levels to proper R variable names using make.names() which changed the labels from e.g., 4 to X4) and the title of the legend. We also change the labels on the x and y axis.

    +

    We now produce a new variant of the left plot using more appropriate error bars and change several other graphical details which make the plot publication ready. We use the factor_levels argument to afex_plot() for renaming the factor levels (for technical reasons the ANOVA functions in afex transform all factor levels to proper R variable names using make.names() which changed the labels from e.g., 4 to X4) and the legend_title argument for changing the title of the legend. We also change the labels on the x and y axis.

    p_an <- afex_plot(aw, x = "angle", trace = "noise", error = "within",
                       factor_levels = list(angle = c("0°", "4°", "8°"),
                                         noise = c("Absent", "Present")), 
                       legend_title = "Noise") +
       labs(y = "RTs (in ms)", x = "Angle (in degrees)")
    +
    ## Renaming/reordering factor levels of 'angle':
    +##   X0 -> 0°
    +##   X4 -> 4°
    +##   X8 -> 8°
    +
    ## Renaming/reordering factor levels of 'noise':
    +##   absent -> Absent
    +##   present -> Present
    +

    As the additional output shows, changing the factor levels via factor_levels emits a message detailing old and new factor levels in the form old -> new. This message can be suppressed by wrapping the afex_plot() call into a suppressMessages() call or via RMarkdown settings. Note that we could have also used the factor_levels argument for changing the order of the factor levels by passing a named character vector (e.g., factor_levels = list(angle = c(X8 = "8°", X4 = "4°", X0 = "0°"))). This would change the order either on the x-axis or in the legend.

    As said above, I am not a big fan of the default grey theme of ggplot2 plots. Consequently, we compare a number of different themes for this plot in the following. For all but ggpubr::theme_pubr(), we also move the legend to the bottom as this better allows the plot to cover only a single column in a two-column layout. ggpubr::theme_pubr() automatically plots the legend on top.

    plot_grid(
       p_an + theme_bw() + theme(legend.position="bottom"),
    @@ -258,7 +265,7 @@
                     point_arg = list(size = 2.5), 
                     error_arg = list(size = 1.5, width = 0))
     plot_grid(p1, p2, p3, p4, p5, p6, ncol = 2, labels = 1:6)  
    -

    +

    Adding Color to Plots

    @@ -289,7 +296,7 @@ line_arg = list(linetype = 0), error_arg = list(size = 1.5, width = 0)) plot_grid(p2, p3, p4, p5, ncol = 2, labels = 2:5)
    -

    +

    Plotting Order and Error Bars

    @@ -327,7 +334,7 @@ error_arg = list(size = 1.5, width = 0.05)) + theme(legend.position="none") plot_grid(po1, po2)
    -

    +

    One-way plots can also be split across different panels by specifying a panel factor:

    afex_plot(aw, x = "angle", panel = "noise", error = "within",
               data_geom = ggpol::geom_boxjitter,
    @@ -341,13 +348,13 @@
               point_arg = list(size = 2.5),
               error_arg = list(size = 1.5, width = 0.05)) +
       theme(legend.position="none")
    -

    +

    Sometimes we still want to add a line connecting the estimated marginal means. As afex_plot returns a ggplot2 object, we can do this easily by adding a geom_line() object to the call. As we want to add a line through all of the shown points in the foreground, we need to add the corresponding groups aesthetics to this call: geom_line(aes(group = 1)). We can add further arguments to this call, as shown in the left panel below.

    plot_grid(
       po1 + geom_line(aes(group = 1), color = "darkgrey", size = 1.5), 
       po2 + geom_line(aes(group = 1))
     ) 
    -

    +

    @@ -437,6 +444,7 @@ ## nonword low - nonword high 0.1091 0.0157 Inf 6.955 <.0001 ## word high - nonword high -0.0335 0.0225 Inf -1.485 0.4464 ## +## Degrees-of-freedom method: asymptotic ## P value adjustment: tukey method for comparing a family of 4 estimates

    An alternative in the present situation would be using within-subjects error bars and aggregating the data by-id (i.e., error = "within"), as done in the left panel below. This is somewhat appropriate here as the factors within each panel are all within-subject factors. In contrast, using by-item within-subjects error bars, as done in the right panel below, seems not appropriate as the only within-item factor, task, is spread across panels. Unfortunately, it is not immediately clear if these error bars allow one to correctly detect, which means do not differ from each other.

    plot_grid( 
    diff -Nru r-cran-afex-0.25-1/inst/doc/afex_plot_introduction.Rmd r-cran-afex-0.26-0/inst/doc/afex_plot_introduction.Rmd
    --- r-cran-afex-0.25-1/inst/doc/afex_plot_introduction.Rmd	2019-08-27 16:39:44.000000000 +0000
    +++ r-cran-afex-0.26-0/inst/doc/afex_plot_introduction.Rmd	2020-01-15 20:56:03.000000000 +0000
    @@ -68,7 +68,7 @@
     
     ## Exploring Graphical Options and Themes
     
    -We now produce a new variant of the left plot using more appropriate error bars and change several other graphical details which make the plot publication ready. We use the ability of `afex_plot()` to rename the factor levels (for technical reasons the ANOVA functions in `afex` transform all factor levels to proper `R` variable names using `make.names()` which changed the labels from e.g., `4` to `X4`) and the title of the legend. We also change the labels on the `x` and `y` axis. 
    +We now produce a new variant of the left plot using more appropriate error bars and change several other graphical details which make the plot publication ready. We use the `factor_levels` argument to `afex_plot()` for renaming the factor levels (for technical reasons the ANOVA functions in `afex` transform all factor levels to proper `R` variable names using `make.names()` which changed the labels from e.g., `4` to `X4`) and the `legend_title` argument for changing the title of the legend. We also change the labels on the `x` and `y` axis. 
     
     
     ```{r}
    @@ -79,6 +79,7 @@
       labs(y = "RTs (in ms)", x = "Angle (in degrees)")
     ```
     
    +As the additional output shows, changing the factor levels via `factor_levels` emits a `message` detailing old and new factor levels in the form `old -> new`. This message can be suppressed by wrapping the `afex_plot()` call into a `suppressMessages()` call or via `RMarkdown` settings. Note that we could have also used the `factor_levels` argument for changing the order of the factor levels by passing a named character vector (e.g., `factor_levels = list(angle = c(X8 = "8°", X4 = "4°", X0 = "0°"))`). This would change the order either on the x-axis or in the legend.
     
     As said above, I am not a big fan of the default grey theme of `ggplot2` plots. Consequently, we compare a number of different themes for this plot in the following. For all but `ggpubr::theme_pubr()`, we also move the legend to the bottom as this better allows the plot to cover only a single column in a two-column layout. `ggpubr::theme_pubr()` automatically plots the legend on top.
     
    diff -Nru r-cran-afex-0.25-1/inst/doc/afex_plot_supported_models.html r-cran-afex-0.26-0/inst/doc/afex_plot_supported_models.html
    --- r-cran-afex-0.25-1/inst/doc/afex_plot_supported_models.html	2019-08-27 16:58:58.000000000 +0000
    +++ r-cran-afex-0.26-0/inst/doc/afex_plot_supported_models.html	2020-01-15 21:03:10.000000000 +0000
    @@ -1,11 +1,10 @@
     
     
    -
    +
     
     
     
     
    -
     
     
     
    @@ -13,7 +12,7 @@
     
     
     
    -
    +
     
     afex_plot: Supported Models
     
    @@ -96,7 +95,7 @@
     
     

    afex_plot: Supported Models

    Henrik Singmann

    -

    2019-08-27

    +

    2020-01-15

    @@ -252,7 +251,7 @@ ## dv column detected: count ## No id column passed. Assuming all rows are independent samples. plot_grid(a, b, labels = "AUTO")
    -

    +

    For the final plot we also plot the interaction, but this time aggregate the individual-data within site. This allows us again to use a beeswarm plot (after decreasing the width of the “bees”) and produces a relatively clear result.

    afex_plot(tmb, "spp", "mined", id = "site", data = Salamanders, 
               data_geom = ggbeeswarm::geom_beeswarm, 
    diff -Nru r-cran-afex-0.25-1/man/afex_aov-methods.Rd r-cran-afex-0.26-0/man/afex_aov-methods.Rd
    --- r-cran-afex-0.25-1/man/afex_aov-methods.Rd	2018-09-22 20:49:38.000000000 +0000
    +++ r-cran-afex-0.26-0/man/afex_aov-methods.Rd	2020-01-15 20:36:09.000000000 +0000
    @@ -9,10 +9,17 @@
     \alias{emm_basis.afex_aov}
     \title{Methods for afex_aov objects}
     \usage{
    -\method{anova}{afex_aov}(object, es = afex_options("es_aov"),
    -  observed = NULL, correction = afex_options("correction_aov"),
    -  MSE = TRUE, intercept = FALSE, p_adjust_method = NULL,
    -  sig_symbols = attr(object$anova_table, "sig_symbols"), ...)
    +\method{anova}{afex_aov}(
    +  object,
    +  es = afex_options("es_aov"),
    +  observed = NULL,
    +  correction = afex_options("correction_aov"),
    +  MSE = TRUE,
    +  intercept = FALSE,
    +  p_adjust_method = NULL,
    +  sig_symbols = attr(object$anova_table, "sig_symbols"),
    +  ...
    +)
     
     \method{print}{afex_aov}(x, ...)
     
    @@ -20,8 +27,14 @@
     
     recover_data.afex_aov(object, ..., model = afex_options("emmeans_model"))
     
    -emm_basis.afex_aov(object, trms, xlev, grid, ...,
    -  model = afex_options("emmeans_model"))
    +emm_basis.afex_aov(
    +  object,
    +  trms,
    +  xlev,
    +  grid,
    +  ...,
    +  model = afex_options("emmeans_model")
    +)
     }
     \arguments{
     \item{object, x}{object of class \code{afex_aov} as returned from \code{\link{aov_car}} and related functions.}
    diff -Nru r-cran-afex-0.25-1/man/afex-package.Rd r-cran-afex-0.26-0/man/afex-package.Rd
    --- r-cran-afex-0.25-1/man/afex-package.Rd	2019-08-01 16:59:41.000000000 +0000
    +++ r-cran-afex-0.26-0/man/afex-package.Rd	2020-01-15 20:36:09.000000000 +0000
    @@ -24,13 +24,13 @@
     
     }
     \author{
    -\strong{Maintainer}: Henrik Singmann \email{singmann+afex@gmail.com} (0000-0002-4842-3657)
    +\strong{Maintainer}: Henrik Singmann \email{singmann+afex@gmail.com} (\href{https://orcid.org/0000-0002-4842-3657}{ORCID})
     
     Authors:
     \itemize{
       \item Ben Bolker
       \item Jake Westfall
    -  \item Frederik Aust (0000-0003-4900-788X)
    +  \item Frederik Aust (\href{https://orcid.org/0000-0003-4900-788X}{ORCID})
       \item Mattan S. Ben-Shachar
     }
     
    diff -Nru r-cran-afex-0.25-1/man/afex_plot.Rd r-cran-afex-0.26-0/man/afex_plot.Rd
    --- r-cran-afex-0.25-1/man/afex_plot.Rd	2019-08-01 16:59:41.000000000 +0000
    +++ r-cran-afex-0.26-0/man/afex_plot.Rd	2020-01-15 20:37:11.000000000 +0000
    @@ -12,52 +12,149 @@
     \usage{
     afex_plot(object, ...)
     
    -\method{afex_plot}{afex_aov}(object, x, trace, panel, mapping,
    -  error = "model", error_ci = TRUE, error_level = 0.95,
    -  error_arg = list(width = 0), data_plot = TRUE, data_geom,
    -  data_alpha = 0.5, data_arg = list(color = "darkgrey"),
    -  point_arg = list(), line_arg = list(), emmeans_arg = list(),
    -  dodge = 0.5, return = "plot", factor_levels = list(), legend_title,
    -  ...)
    -
    -\method{afex_plot}{mixed}(object, x, trace, panel, mapping, id,
    -  error = "model", error_ci = TRUE, error_level = 0.95,
    -  error_arg = list(width = 0), data_plot = TRUE, data_geom,
    -  data_alpha = 0.5, data_arg = list(color = "darkgrey"),
    -  point_arg = list(), line_arg = list(), emmeans_arg = list(),
    -  dodge = 0.5, return = "plot", factor_levels = list(), legend_title,
    -  ...)
    -
    -\method{afex_plot}{merMod}(object, x, trace, panel, mapping, id,
    -  error = "model", error_ci = TRUE, error_level = 0.95,
    -  error_arg = list(width = 0), data_plot = TRUE, data_geom,
    -  data_alpha = 0.5, data_arg = list(color = "darkgrey"),
    -  point_arg = list(), line_arg = list(), emmeans_arg = list(),
    -  dodge = 0.5, return = "plot", factor_levels = list(), legend_title,
    -  ...)
    -
    -\method{afex_plot}{default}(object, x, trace, panel, mapping, id, dv, data,
    -  within_vars, between_vars, error = "model", error_ci = TRUE,
    -  error_level = 0.95, error_arg = list(width = 0), data_plot = TRUE,
    -  data_geom, data_alpha = 0.5, data_arg = list(color = "darkgrey"),
    -  point_arg = list(), line_arg = list(), emmeans_arg = list(),
    -  dodge = 0.5, return = "plot", factor_levels = list(), legend_title,
    -  ...)
    -
    -interaction_plot(means, data, mapping = c("shape", "lineytpe"),
    -  error_plot = TRUE, error_arg = list(width = 0), data_plot = TRUE,
    -  data_geom = ggplot2::geom_point, data_alpha = 0.5,
    -  data_arg = list(color = "darkgrey"), point_arg = list(),
    -  line_arg = list(), dodge = 0.5, legend_title, col_x = "x",
    -  col_y = "y", col_trace = "trace", col_panel = "panel",
    -  col_lower = "lower", col_upper = "upper")
    -
    -oneway_plot(means, data, mapping = "", error_plot = TRUE,
    -  error_arg = list(width = 0), data_plot = TRUE,
    -  data_geom = ggbeeswarm::geom_beeswarm, data_alpha = 0.5,
    -  data_arg = list(color = "darkgrey"), point_arg = list(),
    -  legend_title, col_x = "x", col_y = "y", col_panel = "panel",
    -  col_lower = "lower", col_upper = "upper")
    +\method{afex_plot}{afex_aov}(
    +  object,
    +  x,
    +  trace,
    +  panel,
    +  mapping,
    +  error = "model",
    +  error_ci = TRUE,
    +  error_level = 0.95,
    +  error_arg = list(width = 0),
    +  data_plot = TRUE,
    +  data_geom,
    +  data_alpha = 0.5,
    +  data_arg = list(color = "darkgrey"),
    +  point_arg = list(),
    +  line_arg = list(),
    +  emmeans_arg = list(),
    +  dodge = 0.5,
    +  return = "plot",
    +  factor_levels = list(),
    +  legend_title,
    +  ...
    +)
    +
    +\method{afex_plot}{mixed}(
    +  object,
    +  x,
    +  trace,
    +  panel,
    +  mapping,
    +  id,
    +  error = "model",
    +  error_ci = TRUE,
    +  error_level = 0.95,
    +  error_arg = list(width = 0),
    +  data_plot = TRUE,
    +  data_geom,
    +  data_alpha = 0.5,
    +  data_arg = list(color = "darkgrey"),
    +  point_arg = list(),
    +  line_arg = list(),
    +  emmeans_arg = list(),
    +  dodge = 0.5,
    +  return = "plot",
    +  factor_levels = list(),
    +  legend_title,
    +  ...
    +)
    +
    +\method{afex_plot}{merMod}(
    +  object,
    +  x,
    +  trace,
    +  panel,
    +  mapping,
    +  id,
    +  error = "model",
    +  error_ci = TRUE,
    +  error_level = 0.95,
    +  error_arg = list(width = 0),
    +  data_plot = TRUE,
    +  data_geom,
    +  data_alpha = 0.5,
    +  data_arg = list(color = "darkgrey"),
    +  point_arg = list(),
    +  line_arg = list(),
    +  emmeans_arg = list(),
    +  dodge = 0.5,
    +  return = "plot",
    +  factor_levels = list(),
    +  legend_title,
    +  ...
    +)
    +
    +\method{afex_plot}{default}(
    +  object,
    +  x,
    +  trace,
    +  panel,
    +  mapping,
    +  id,
    +  dv,
    +  data,
    +  within_vars,
    +  between_vars,
    +  error = "model",
    +  error_ci = TRUE,
    +  error_level = 0.95,
    +  error_arg = list(width = 0),
    +  data_plot = TRUE,
    +  data_geom,
    +  data_alpha = 0.5,
    +  data_arg = list(color = "darkgrey"),
    +  point_arg = list(),
    +  line_arg = list(),
    +  emmeans_arg = list(),
    +  dodge = 0.5,
    +  return = "plot",
    +  factor_levels = list(),
    +  legend_title,
    +  ...
    +)
    +
    +interaction_plot(
    +  means,
    +  data,
    +  mapping = c("shape", "lineytpe"),
    +  error_plot = TRUE,
    +  error_arg = list(width = 0),
    +  data_plot = TRUE,
    +  data_geom = ggplot2::geom_point,
    +  data_alpha = 0.5,
    +  data_arg = list(color = "darkgrey"),
    +  point_arg = list(),
    +  line_arg = list(),
    +  dodge = 0.5,
    +  legend_title,
    +  col_x = "x",
    +  col_y = "y",
    +  col_trace = "trace",
    +  col_panel = "panel",
    +  col_lower = "lower",
    +  col_upper = "upper"
    +)
    +
    +oneway_plot(
    +  means,
    +  data,
    +  mapping = "",
    +  error_plot = TRUE,
    +  error_arg = list(width = 0),
    +  data_plot = TRUE,
    +  data_geom = ggbeeswarm::geom_beeswarm,
    +  data_alpha = 0.5,
    +  data_arg = list(color = "darkgrey"),
    +  point_arg = list(),
    +  legend_title,
    +  col_x = "x",
    +  col_y = "y",
    +  col_panel = "panel",
    +  col_lower = "lower",
    +  col_upper = "upper"
    +)
     }
     \arguments{
     \item{object}{\code{afex_aov}, \code{mixed}, \code{merMod} or other model
    @@ -142,9 +239,15 @@
     data used for plotting: \code{means} contains the means and standard errors
     for the foreground, \code{data} contains the raw data in the background.}
     
    -\item{factor_levels}{A \code{list} of new factor levels that should be used in 
    -the plot. The name of each list entry needs to correspond to one of the 
    -factors in the plot.}
    +\item{factor_levels}{A \code{list} of new factor levels that should be used
    +in the plot. The name of each list entry needs to correspond to one of the
    +factors in the plot. Each list element can optionally be a named character
    +vector where the name corresponds to the old factor level and the value to
    +the new factor level. Named vectors allow two things: (1) updating only a
    +subset of factor levels (if only a subset of levels is specified) and (2)
    +reordering (and renaming) the factor levels, as order of names within a
    +list element are the order that will be used for plotting. If specified,
    +emits a \code{message} with \code{old -> new} factor levels.}
     
     \item{legend_title}{A scalar \code{character} vector with a new title for the
     legend.}
    @@ -487,11 +590,21 @@
     ##                      Other Basic Options                     -
     ##---------------------------------------------------------------
     
    -## relabel factor levels via factor_levels
    +## relabel factor levels via factor_levels (with message)
     afex_plot(aw, x = "noise", trace = "angle", 
               factor_levels = list(angle = c("0°", "4°", "8°"),
                                    noise = c("Absent", "Present")))
     
    +## factor_levels allows named vectors which enable reordering the factor levels 
    +### and renaming subsets of levels:
    +afex_plot(aw, x = "noise", trace = "angle", 
    +          factor_levels = list(
    +            angle = c(X8 = "8°", X4 = "4°", X0 = "0°"),
    +            noise = c(present = "Present")
    +          )
    +)
    +
    +
     ## Change title of legend
     afex_plot(aw, x = "noise", trace = "angle", 
               legend_title = "Noise Condition")
    diff -Nru r-cran-afex-0.25-1/man/all_fit.Rd r-cran-afex-0.26-0/man/all_fit.Rd
    --- r-cran-afex-0.25-1/man/all_fit.Rd	2019-02-18 22:08:30.000000000 +0000
    +++ r-cran-afex-0.26-0/man/all_fit.Rd	2020-01-15 20:36:09.000000000 +0000
    @@ -5,10 +5,15 @@
     \alias{nmkbw}
     \title{Refit \code{lmer} model using multiple optimizers}
     \usage{
    -all_fit(m, meth_tab = cbind(optimizer = rep(c("bobyqa", "Nelder_Mead",
    -  "optimx", "nloptwrap", "nmkbw"), c(1, 1, 2, 2, 1)), method = c("", "",
    -  "nlminb", "L-BFGS-B", "NLOPT_LN_NELDERMEAD", "NLOPT_LN_BOBYQA", "")),
    -  verbose = TRUE, maxfun = 1e+06, ...)
    +all_fit(
    +  m,
    +  meth_tab = cbind(optimizer = rep(c("bobyqa", "Nelder_Mead", "optimx", "nloptwrap",
    +    "nmkbw"), c(1, 1, 2, 2, 1)), method = c("", "", "nlminb", "L-BFGS-B",
    +    "NLOPT_LN_NELDERMEAD", "NLOPT_LN_BOBYQA", "")),
    +  verbose = TRUE,
    +  maxfun = 1e+06,
    +  ...
    +)
     
     nmkbw(fn, par, lower, upper, control)
     }
    diff -Nru r-cran-afex-0.25-1/man/aov_car.Rd r-cran-afex-0.26-0/man/aov_car.Rd
    --- r-cran-afex-0.25-1/man/aov_car.Rd	2019-08-01 16:59:41.000000000 +0000
    +++ r-cran-afex-0.26-0/man/aov_car.Rd	2020-01-15 20:36:09.000000000 +0000
    @@ -7,26 +7,54 @@
     \alias{aov_ez}
     \title{Convenient ANOVA estimation for factorial designs}
     \usage{
    -aov_car(formula, data, fun_aggregate = NULL,
    -  type = afex_options("type"), factorize = afex_options("factorize"),
    -  check_contrasts = afex_options("check_contrasts"), observed = NULL,
    -  anova_table = list(), include_aov = afex_options("include_aov"),
    -  return = afex_options("return_aov"), ...)
    +aov_car(
    +  formula,
    +  data,
    +  fun_aggregate = NULL,
    +  type = afex_options("type"),
    +  factorize = afex_options("factorize"),
    +  check_contrasts = afex_options("check_contrasts"),
    +  observed = NULL,
    +  anova_table = list(),
    +  include_aov = afex_options("include_aov"),
    +  return = afex_options("return_aov"),
    +  ...
    +)
     
    -aov_4(formula, data, observed = NULL, fun_aggregate = NULL,
    -  type = afex_options("type"), factorize = afex_options("factorize"),
    +aov_4(
    +  formula,
    +  data,
    +  observed = NULL,
    +  fun_aggregate = NULL,
    +  type = afex_options("type"),
    +  factorize = afex_options("factorize"),
       check_contrasts = afex_options("check_contrasts"),
    -  return = afex_options("return_aov"), anova_table = list(),
    -  include_aov = afex_options("include_aov"), ...,
    -  print.formula = FALSE)
    +  return = afex_options("return_aov"),
    +  anova_table = list(),
    +  include_aov = afex_options("include_aov"),
    +  ...,
    +  print.formula = FALSE
    +)
     
    -aov_ez(id, dv, data, between = NULL, within = NULL, covariate = NULL,
    -  observed = NULL, fun_aggregate = NULL, transformation,
    -  type = afex_options("type"), factorize = afex_options("factorize"),
    +aov_ez(
    +  id,
    +  dv,
    +  data,
    +  between = NULL,
    +  within = NULL,
    +  covariate = NULL,
    +  observed = NULL,
    +  fun_aggregate = NULL,
    +  transformation,
    +  type = afex_options("type"),
    +  factorize = afex_options("factorize"),
       check_contrasts = afex_options("check_contrasts"),
    -  return = afex_options("return_aov"), anova_table = list(),
    -  include_aov = afex_options("include_aov"), ...,
    -  print.formula = FALSE)
    +  return = afex_options("return_aov"),
    +  anova_table = list(),
    +  include_aov = afex_options("include_aov"),
    +  ...,
    +  print.formula = FALSE
    +)
     }
     \arguments{
     \item{formula}{A formula specifying the ANOVA model similar to
    diff -Nru r-cran-afex-0.25-1/man/mixed.Rd r-cran-afex-0.26-0/man/mixed.Rd
    --- r-cran-afex-0.25-1/man/mixed.Rd	2019-08-01 16:59:41.000000000 +0000
    +++ r-cran-afex-0.26-0/man/mixed.Rd	2020-01-15 20:36:09.000000000 +0000
    @@ -6,13 +6,24 @@
     \alias{lmer_alt}
     \title{p-values for fixed effects of mixed-model via lme4::lmer()}
     \usage{
    -mixed(formula, data, type = afex_options("type"),
    -  method = afex_options("method_mixed"), per_parameter = NULL,
    -  args_test = list(), test_intercept = FALSE,
    -  check_contrasts = afex_options("check_contrasts"), expand_re = FALSE,
    -  all_fit = FALSE, set_data_arg = afex_options("set_data_arg"),
    -  progress = TRUE, cl = NULL, return = "mixed",
    -  sig_symbols = afex_options("sig_symbols"), ...)
    +mixed(
    +  formula,
    +  data,
    +  type = afex_options("type"),
    +  method = afex_options("method_mixed"),
    +  per_parameter = NULL,
    +  args_test = list(),
    +  test_intercept = FALSE,
    +  check_contrasts = afex_options("check_contrasts"),
    +  expand_re = FALSE,
    +  all_fit = FALSE,
    +  set_data_arg = afex_options("set_data_arg"),
    +  progress = TRUE,
    +  cl = NULL,
    +  return = "mixed",
    +  sig_symbols = afex_options("sig_symbols"),
    +  ...
    +)
     
     lmer_alt(formula, data, check_contrasts = FALSE, ...)
     }
    diff -Nru r-cran-afex-0.25-1/man/nice.Rd r-cran-afex-0.26-0/man/nice.Rd
    --- r-cran-afex-0.25-1/man/nice.Rd	2019-02-18 15:59:19.000000000 +0000
    +++ r-cran-afex-0.26-0/man/nice.Rd	2020-01-15 20:36:09.000000000 +0000
    @@ -11,18 +11,28 @@
     \usage{
     nice(object, ...)
     
    -\method{nice}{afex_aov}(object, es = attr(object$anova_table, "es"),
    +\method{nice}{afex_aov}(
    +  object,
    +  es = attr(object$anova_table, "es"),
       observed = attr(object$anova_table, "observed"),
    -  correction = attr(object$anova_table, "correction"), MSE = NULL,
    -  intercept = NULL, p_adjust_method = attr(object$anova_table,
    -  "p_adjust_method"), sig_symbols = attr(object$anova_table,
    -  "sig_symbols"), ...)
    +  correction = attr(object$anova_table, "correction"),
    +  MSE = NULL,
    +  intercept = NULL,
    +  p_adjust_method = attr(object$anova_table, "p_adjust_method"),
    +  sig_symbols = attr(object$anova_table, "sig_symbols"),
    +  ...
    +)
     
    -\method{nice}{anova}(object, MSE = NULL, intercept = NULL,
    -  sig_symbols = attr(object, "sig_symbols"), sig.symbols, ...)
    +\method{nice}{anova}(
    +  object,
    +  MSE = NULL,
    +  intercept = NULL,
    +  sig_symbols = attr(object, "sig_symbols"),
    +  sig.symbols,
    +  ...
    +)
     
    -\method{nice}{mixed}(object, sig_symbols = attr(object$anova_table,
    -  "sig_symbols"), ...)
    +\method{nice}{mixed}(object, sig_symbols = attr(object$anova_table, "sig_symbols"), ...)
     
     \method{print}{nice_table}(x, ...)
     }
    diff -Nru r-cran-afex-0.25-1/man/sk2011.1.Rd r-cran-afex-0.26-0/man/sk2011.1.Rd
    --- r-cran-afex-0.25-1/man/sk2011.1.Rd	2018-09-22 20:49:38.000000000 +0000
    +++ r-cran-afex-0.26-0/man/sk2011.1.Rd	2020-01-15 20:36:09.000000000 +0000
    @@ -26,7 +26,7 @@
     A person is wet.  \cr
     How valid is the conclusion/How likely is it that the person fell into a swimming pool?
     
    -Our study also included valid and plausible and invalid and implausible problems.
    +Our study also included valid and plausible and invalid and implausible problems. 
     
     Note that the factor `plausibility` is not present in the original manuscript, there it is a results of a combination of other factors.
     }
    diff -Nru r-cran-afex-0.25-1/MD5 r-cran-afex-0.26-0/MD5
    --- r-cran-afex-0.25-1/MD5	2019-08-27 18:10:02.000000000 +0000
    +++ r-cran-afex-0.26-0/MD5	2020-01-16 05:40:04.000000000 +0000
    @@ -1,9 +1,9 @@
    -5dbef081b7ca813a98b853441b8418c0 *DESCRIPTION
    +ba75bd61845f1a0c86a8cd43e3d98d66 *DESCRIPTION
     6767ed4da737ac59f83c457754c3bf97 *NAMESPACE
    -ef4c6114698a0febc7eb1e405439a28b *NEWS
    +cc77d6e58e536e55a114a4d664d5cceb *NEWS
     cfeee35fcc6b1e696475568c4bb8650e *R/afex-package.R
    -a554c7f474fa17d47ef459bd15b643b2 *R/afex_plot.R
    -2d9f901c14b11054cca91bb4f7b742a1 *R/afex_plot_utils.R
    +2aca6322cb4a260884e0952bc6d1028d *R/afex_plot.R
    +81e42f190717ccaf52dbf64ddaca7959 *R/afex_plot_utils.R
     f2c2c6dd79391fad79ba0373e6bfd947 *R/allFit.R
     41896de79fa0d8b6653aacd2a6b584f8 *R/aov_car.R
     968340bb61351a9f15b0e8b3089cb840 *R/compare.2.vectors.R
    @@ -29,8 +29,8 @@
     57b5621c3837894f3ea1578cfb312754 *R/test_assumption.R
     e0e75cef93a2c20bfdae12be6e73a419 *R/utils.R
     7c0fdfbd113051b06876ba07902e7314 *R/zzz.R
    -db205acf36ca1b0a18312e1dd790273d *build/partial.rdb
    -7ce12c949b1b6ef888ddf6f93387eb51 *build/vignette.rds
    +7950b147d845e92e4126afdce284533e *build/partial.rdb
    +0e9875cdb6a3689c8e3bb822af74eb2b *build/vignette.rds
     67d99926047ef78d0e5dd54b89ae9eb7 *data/fhch2010.rda
     dc520acd438387964b4561483968f18e *data/ks2013.3.rda
     4df2c0c2a5a52ff004bd015e90f8e328 *data/md_12.1.rda
    @@ -42,16 +42,16 @@
     30d68b1cca41bab8e71a24b7b48489be *data/sk2011.2.rda
     c88657f4f1f1e2a5361cab5876cc37ff *inst/doc/afex_anova_example.R
     39419410f2d0d5016a265f7e4e3a6a01 *inst/doc/afex_anova_example.Rmd
    -1115ac2ab59d961f400dca03082adcb1 *inst/doc/afex_anova_example.html
    +e6ff500245859d985f7768114578023f *inst/doc/afex_anova_example.html
     22d77c48d124471aff3215a719cafe7a *inst/doc/afex_mixed_example.R
     68041082ce7be67cc1167a02881f9cbe *inst/doc/afex_mixed_example.Rmd
    -ca4a537604ee436aadac8f2d8a6711ab *inst/doc/afex_mixed_example.html
    +b550f7a9b5773b674c0ce9fd90c30f0a *inst/doc/afex_mixed_example.html
     fdedf674e0ff763cf77425371ea36439 *inst/doc/afex_plot_introduction.R
    -ba2d6baedc7e490a196b6d8255e6f7bc *inst/doc/afex_plot_introduction.Rmd
    -74b650352c12f6ccee20bc13cd4e5254 *inst/doc/afex_plot_introduction.html
    +e6458e4b7a6e7a9a13565a9468ef0f35 *inst/doc/afex_plot_introduction.Rmd
    +c5d1d94a2d8a1f46bd0146fdb8a5b26a *inst/doc/afex_plot_introduction.html
     9f5c461e41fcbebead76abaf2e42c59f *inst/doc/afex_plot_supported_models.R
     7e348afffddd2f729cd693fca12d0c7e *inst/doc/afex_plot_supported_models.Rmd
    -5ce588dc8992e0da62bcbbf1234264b8 *inst/doc/afex_plot_supported_models.html
    +90c97d000c61ddec0a69667492ab7938 *inst/doc/afex_plot_supported_models.html
     6a71de31c059b7613a664d6ecb02877b *inst/doc/introduction-mixed-models.pdf
     094500fbc23322b68eec11cf9a713c22 *inst/doc/introduction-mixed-models.pdf.asis
     a06958c98c7491366f1b6712bd29a112 *inst/extdata/freeman_models.rda
    @@ -59,12 +59,12 @@
     399fc6d1638fca1b9e81e05dbce265f0 *inst/extdata/plots_brms.rda
     585fa3a9da694d40c19a6cc4e599299d *inst/extdata/plots_rstanarm.rda
     9d375950472c16d253afa8591d6b8c2b *inst/extdata/tmb_example_fit.rda
    -899e57a41e1a1287e259a948dea4106c *man/afex-package.Rd
    -0222da32da2536630a702134abf3d959 *man/afex_aov-methods.Rd
    +d3f8ed99914c90d854da06215072e0ff *man/afex-package.Rd
    +03daff78f74482a54f626f09c6967888 *man/afex_aov-methods.Rd
     aa397f5e9ae4fe68c8d01415a720cbd8 *man/afex_options.Rd
    -037a3d736368aac2940b98d154f91c9f *man/afex_plot.Rd
    -5ecba97eb91a924069df2be85195f567 *man/all_fit.Rd
    -49d5e7729fd8dad2394a7f75a794bf7c *man/aov_car.Rd
    +99c12f99e05a14fba7043d1bef5f0f28 *man/afex_plot.Rd
    +13bded207e185fdbeecd2fff2327dced *man/all_fit.Rd
    +9caa0b3d4375f8ca52d44d81cee9efeb *man/aov_car.Rd
     b689b18886df4717b1ea0ce162eb1928 *man/compare.2.vectors.Rd
     f32ef57dccf93bd7344db3d298f1467e *man/deprecated.Rd
     3cd5db0fc787d0cd7c0a64545cedc82f *man/ems.Rd
    @@ -74,13 +74,13 @@
     8f4eb8301c600bbc0f783bf2f4bc1de5 *man/md_15.1.Rd
     3ab1136bf1b2c773b52be8fb2dd8c609 *man/md_16.1.Rd
     ddf582b843028a66b7a1a8212f69ae90 *man/md_16.4.Rd
    -9d9076c61961fd19bd5d5c1732114b97 *man/mixed.Rd
    -512e5ae74d05786ada9059a7bfebd8bf *man/nice.Rd
    +727532b0ef49649f5caf982f5fc6f0b9 *man/mixed.Rd
    +b9e23866a86da2971f5907719ba2b70f *man/nice.Rd
     521566b18efdb0d7be641136b8530367 *man/obk.long.Rd
     d96189cd838f18944251d1f86ffa2024 *man/reexports.Rd
     00cc93b3341126748ab03752455f0647 *man/round_ps.Rd
     19b5f2bbbd29b4717c09a0b8393579f2 *man/set_sum_contrasts.Rd
    -d22e930f399907fbba3d98446e6b12f1 *man/sk2011.1.Rd
    +c0c81131ea4b7fcfde40156cc2f0d475 *man/sk2011.1.Rd
     73b9e70539a5b81ca0d9f7f2acf74e69 *man/sk2011.2.Rd
     5f2f37cb8aca4649c2f70a825ed960bf *man/test_assumptions.Rd
     2d343f0d270a71a9cf1a10b3c6bf200b *tests/testthat.R
    @@ -90,11 +90,11 @@
     34150eb0876b348943477a65c6e8a7e9 *tests/testthat/m_machines_lmerTest-pre3.0.rda
     6c14ea76e8082da1001761f83c2cdd64 *tests/testthat/mixed_with_dot.rda
     99cdf51f695aa867276c309c21e1ab1e *tests/testthat/test-afex_aov.R
    -7e3139e59ecc9c3e5d6c48bc492c111d *tests/testthat/test-afex_plot-basics.R
    +f8c4cb2af1aed006dc04a443829c20f3 *tests/testthat/test-afex_plot-basics.R
     30f299823abd177b14f70ea1ea7dc735 *tests/testthat/test-afex_plot-default-support.R
     76f6691c8a44bd724f372fa4ba332f47 *tests/testthat/test-afex_plot-vignette.R
     2627da29e85a85164e957e7d3ea8771d *tests/testthat/test-aov_car-basic.R
    -1b7b79d1900745b68ebcacd4c94e5e68 *tests/testthat/test-aov_car-bugs.R
    +2e5be5c054c616c3a63799fd25d0a469 *tests/testthat/test-aov_car-bugs.R
     51d28d7530d1e4fc27c861d032ed8102 *tests/testthat/test-aov_car-structural.R
     7fdf87ab2ee65a452121c66a88c3db7c *tests/testthat/test-assumption_tests.R
     abd3af78e5b91665be7b3e386f86e724 *tests/testthat/test-compare_2_vectors.R
    @@ -106,6 +106,6 @@
     5dea995f29a0f4923ec9cf46b9478154 *tests/testthat/test-mixed-structure.R
     39419410f2d0d5016a265f7e4e3a6a01 *vignettes/afex_anova_example.Rmd
     68041082ce7be67cc1167a02881f9cbe *vignettes/afex_mixed_example.Rmd
    -ba2d6baedc7e490a196b6d8255e6f7bc *vignettes/afex_plot_introduction.Rmd
    +e6458e4b7a6e7a9a13565a9468ef0f35 *vignettes/afex_plot_introduction.Rmd
     7e348afffddd2f729cd693fca12d0c7e *vignettes/afex_plot_supported_models.Rmd
     094500fbc23322b68eec11cf9a713c22 *vignettes/introduction-mixed-models.pdf.asis
    diff -Nru r-cran-afex-0.25-1/NEWS r-cran-afex-0.26-0/NEWS
    --- r-cran-afex-0.25-1/NEWS	2019-08-27 14:24:19.000000000 +0000
    +++ r-cran-afex-0.26-0/NEWS	2020-01-15 20:41:58.000000000 +0000
    @@ -1,4 +1,27 @@
                         *************************
    +                    ** afex VERSION 0.26-x **
    +                    *************************
    +                    
    +                    Changes in afex Version 0.26-x
    +                    Released January 2020
    +                    
    +    Significant User Visible Changes and New Features
    +    
    +    o   factor_levels argument of afex_plot() now accepts named character vectors
    +        which allows: 
    +        (1) renaming only a subset of factor levels (if only a subset of levels 
    +            is specified) 
    +        (2) reordering in which order factor levels are shown in the plot (order
    +            of names within a list element determine order that will be used for
    +            plotting)
    +
    +    Bugfixes
    +
    +    o   msq data set is now part of psychTools and not of psych. 
    +        Fixes CRAN check issues.
    +
    +
    +                    *************************
                         ** afex VERSION 0.25-x **
                         *************************
                         
    diff -Nru r-cran-afex-0.25-1/R/afex_plot.R r-cran-afex-0.26-0/R/afex_plot.R
    --- r-cran-afex-0.25-1/R/afex_plot.R	2019-08-27 14:51:00.000000000 +0000
    +++ r-cran-afex-0.26-0/R/afex_plot.R	2020-01-15 20:37:07.000000000 +0000
    @@ -89,9 +89,15 @@
     #'   \code{"data"} returns a list with two \code{data.frame}s containing the 
     #'   data used for plotting: \code{means} contains the means and standard errors
     #'   for the foreground, \code{data} contains the raw data in the background.
    -#' @param factor_levels A \code{list} of new factor levels that should be used in 
    -#'   the plot. The name of each list entry needs to correspond to one of the 
    -#'   factors in the plot. 
    +#' @param factor_levels A \code{list} of new factor levels that should be used
    +#'   in the plot. The name of each list entry needs to correspond to one of the
    +#'   factors in the plot. Each list element can optionally be a named character
    +#'   vector where the name corresponds to the old factor level and the value to
    +#'   the new factor level. Named vectors allow two things: (1) updating only a
    +#'   subset of factor levels (if only a subset of levels is specified) and (2)
    +#'   reordering (and renaming) the factor levels, as order of names within a
    +#'   list element are the order that will be used for plotting. If specified,
    +#'   emits a \code{message} with \code{old -> new} factor levels.
     #' @param legend_title A scalar \code{character} vector with a new title for the
     #'   legend.
     #' @param data For the \code{afex_plot.default} method, an optional
    diff -Nru r-cran-afex-0.25-1/R/afex_plot_utils.R r-cran-afex-0.26-0/R/afex_plot_utils.R
    --- r-cran-afex-0.25-1/R/afex_plot_utils.R	2019-08-01 16:59:41.000000000 +0000
    +++ r-cran-afex-0.26-0/R/afex_plot_utils.R	2020-01-15 20:21:04.000000000 +0000
    @@ -65,6 +65,71 @@
     
     se <- function(x, na.rm = FALSE) sd(x, na.rm = na.rm)/sqrt(length(x))
     
    +rename_factor_levels <- function(data, factor_levels, 
    +                                 status_message = TRUE) {
    +  if (length(factor_levels) > 0) {
    +    if (is.null(names(factor_levels))) {
    +      stop("factor_levels needs to be a named list.", call. = FALSE)
    +    }
    +    if (any(!(names(factor_levels) %in% colnames(data)))) {
    +      if (status_message) {
    +        warning(
    +          "factor_levels: No factor named ", 
    +          paste(
    +            paste0("'", 
    +                   names(factor_levels)
    +                   [!(names(factor_levels) %in% colnames(data))],
    +                   "'"), 
    +            collapse = ", "), 
    +          " in data.",
    +          call. = FALSE
    +        )  
    +      }
    +      factor_levels <- factor_levels[names(factor_levels) %in% colnames(data)]
    +    }
    +    for (i in seq_along(factor_levels)) {
    +      if (is.null(names(factor_levels[[i]]))) {
    +        if (length(factor_levels[[i]]) != 
    +            length(levels(data[[names(factor_levels)[i]]]))) {
    +          stop("length of new factor_levels for '", 
    +               names(factor_levels)[i], "' != length of factor levels.",
    +               call. = FALSE)
    +        }
    +        names(factor_levels[[i]]) <- levels(data[[names(factor_levels)[i]]])
    +      }
    +      factor_levels[[i]] <- factor_levels[[i]][ 
    +        names(factor_levels[[i]]) %in% levels(data[[names(factor_levels)[i]]]) ]
    +      if (status_message) {
    +        message("Renaming/reordering factor levels of '", 
    +                names(factor_levels)[i], "':\n  ", 
    +                paste(
    +                  paste(
    +                    levels(data[[names(factor_levels)[i]]])[
    +                      match(names(factor_levels[[i]]), 
    +                            levels(data[[names(factor_levels)[i]]]))
    +                      ], 
    +                        factor_levels[[i]], sep = " -> "), 
    +                  collapse = "\n  ")
    +        )
    +      }
    +      if (length(factor_levels[[i]]) == 
    +          length(levels(data[[names(factor_levels)[i]]]))) {
    +        data[[names(factor_levels)[i]]] <- factor(
    +          x = data[[names(factor_levels)[i]]], 
    +          levels = names(factor_levels[[i]]), 
    +          labels = factor_levels[[i]]
    +        )  
    +      } else {
    +        levels(data[[names(factor_levels)[i]]])[
    +          match(names(factor_levels[[i]]), 
    +                levels(data[[names(factor_levels)[i]]]))
    +          ] <- factor_levels[[i]]
    +      }
    +    }
    +  }
    +  data
    +}
    +
     get_emms <- function(object, 
                          x,
                          trace,
    @@ -83,9 +148,12 @@
                                              specs = list(all_vars), 
                                              type = list("response"),
                                              emmeans_arg)))
    -  for (i in seq_along(factor_levels)) {
    -    levels(emms[[names(factor_levels)[i]]]) <- factor_levels[[i]]
    -  }
    +  emms <- rename_factor_levels(
    +    data = emms, 
    +    factor_levels = factor_levels, 
    +    status_message = TRUE
    +  )
    +  
       emms$x <- interaction(emms[x], sep = "\n")
       #col_y <- colnames(emms)[which(colnames(emms) == "SE")-1]
       if (any(colnames(emms) == "SE")) {
    @@ -112,9 +180,13 @@
                           factor_levels,
                           dv_col, id) {
       all_vars <- c(x, trace, panel)
    -  for (i in seq_along(factor_levels)) {
    -    levels(data[[names(factor_levels)[i]]]) <- factor_levels[[i]]
    -  }
    +  
    +  data <- rename_factor_levels(
    +    data = data, 
    +    factor_levels = factor_levels, 
    +    status_message = FALSE
    +  )
    +  
       colnames(data)[colnames(data) == dv_col] <- "y"
       if (!is.numeric(data$y)) {
         message("transforming dv to numerical scale")
    @@ -162,8 +234,8 @@
       } else if (error == "mean") {
         ses <- tapply(data$y, INDEX = list(data$all_vars), FUN = se)
         sizes <- tapply(data$y, INDEX = list(data$all_vars), FUN = length)
    -    stopifnot(emms$all_vars == names(ses))
    -    emms$error <- ses
    +    stopifnot(emms$all_vars %in% names(ses))
    +    emms$error <- ses[emms$all_vars]
         emms$lower <- emms$y - qt(1-(1-error_level)/2, sizes - 1) * emms$error
         emms$upper <- emms$y + qt(1-(1-error_level)/2, sizes - 1) * emms$error
       } else if (error %in% c("CMO", "within")) {
    @@ -183,8 +255,8 @@
         new_z <- sqrt(J / (J-1)) * (new_y - y_bar[within_fac]) + y_bar[within_fac]
         ses <- tapply(new_z, INDEX = list(data$all_vars), FUN = se)
         sizes <- tapply(new_z, INDEX = list(data$all_vars), FUN = length)
    -    stopifnot(emms$all_vars == names(ses))
    -    emms$error <- ses
    +    stopifnot(emms$all_vars %in% names(ses))
    +    emms$error <- ses[emms$all_vars]
         emms$lower <- emms$y - qt(1-(1-error_level)/2, sizes - 1) * emms$error
         emms$upper <- emms$y + qt(1-(1-error_level)/2, sizes - 1) * emms$error
       } else if (error == "between") {
    diff -Nru r-cran-afex-0.25-1/tests/testthat/test-afex_plot-basics.R r-cran-afex-0.26-0/tests/testthat/test-afex_plot-basics.R
    --- r-cran-afex-0.25-1/tests/testthat/test-afex_plot-basics.R	2019-08-01 16:59:41.000000000 +0000
    +++ r-cran-afex-0.26-0/tests/testthat/test-afex_plot-basics.R	2020-01-15 20:16:47.000000000 +0000
    @@ -215,7 +215,70 @@
                                            noise = c("Absent", "Present")))
       expect_equal(levels(p1$data$noise), c("Absent", "Present"))
       expect_equal(levels(p1$data$angle), c("0", "4", "8"))
    -
    +  
    +  p2 <- afex_plot(aw, x = "noise", trace = "angle", error = "within",
    +                  factor_levels = list(
    +                    angle = c(X8 = "8", X4 = "4", X0 = "0"),
    +                    noise = c(present = "Present")))
    +  expect_equal(levels(p2$data$angle), rev(c("0", "4", "8")))
    +  expect_equal(levels(p2$data$noise), c("absent", "Present"))
    +  
    +  p1d <- afex_plot(aw, x = "noise", trace = "angle", error = "within",
    +                  factor_levels = list(angle = c("0", "4", "8"),
    +                                       noise = c("Absent", "Present")), 
    +                  return = "data")
    +  p2d <- afex_plot(aw, x = "noise", trace = "angle", error = "within",
    +                  factor_levels = list(
    +                    angle = c(X8 = "8", X4 = "4", X0 = "0"),
    +                    noise = c(present = "Present")), 
    +                  return = "data")
    +  expect_equal(p1d$means$lower, p2d$means$lower)
    +  
    +  expect_warning(p3 <- afex_plot(aw, x = "noise", trace = "angle", error = "mean",
    +                  factor_levels = list(
    +                    angle = c(X8 = "8", X4 = "4", X0 = "0"),
    +                    noise = c(present = "Present"))), 
    +                 "show within-subjects factors, but not within-subjects error bars")
    +  expect_equal(levels(p3$data$angle), rev(c("0", "4", "8")))
    +  
    +  expect_warning(p3d <- afex_plot(aw, x = "noise", trace = "angle", error = "mean",
    +                  factor_levels = list(
    +                    angle = c(X8 = "8", X4 = "4", X0 = "0"),
    +                    noise = c(present = "Present")), 
    +                  return = "data"), 
    +                 "show within-subjects factors, but not within-subjects error bars")
    +  
    +  expect_warning(p3nd <- afex_plot(aw, x = "noise", trace = "angle", error = "mean",
    +                  factor_levels = list(angle = c("0", "4", "8"),
    +                                       noise = c("Absent", "Present")), 
    +                  return = "data"), 
    +                 "show within-subjects factors, but not within-subjects error bars")
    +  expect_equal(p3d$means$lower, p3nd$means$lower)
    +  
    +  expect_warning(p4d <- afex_plot(aw, x = "noise", trace = "angle", 
    +                                  error = "between",
    +                                  factor_levels = list(
    +                                    angle = c(X8 = "8", X4 = "4", X0 = "0"),
    +                                    noise = c(present = "Present")), 
    +                                  return = "data"), 
    +                 "show within-subjects factors, but not within-subjects error bars")
    +  
    +  expect_warning(p4nd <- afex_plot(aw, x = "noise", trace = "angle", 
    +                                   error = "between",
    +                                   factor_levels = list(angle = c("0", "4", "8"),
    +                                                        noise = c("Absent", "Present")), 
    +                                   return = "data"), 
    +                 "show within-subjects factors, but not within-subjects error bars")
    +  expect_equal(p4d$means$lower, p4nd$means$lower)
    +  
    +  expect_error(
    +    afex_plot(aw, x = "noise", trace = "angle", error = "within",
    +                  factor_levels = list(angle = c("0", "4"),
    +                                       noise = c("Absent", "Present"))), 
    +    "length of new factor_levels for 'angle' != length of factor levels"
    +  )
    +  
    +  
       p2 <- afex_plot(aw, x = "noise", trace = "angle", error = "within",
                       legend_title = "Noise Condition")
       expect_equal(p2$guides$shape$title, "Noise Condition")
    diff -Nru r-cran-afex-0.25-1/tests/testthat/test-aov_car-bugs.R r-cran-afex-0.26-0/tests/testthat/test-aov_car-bugs.R
    --- r-cran-afex-0.25-1/tests/testthat/test-aov_car-bugs.R	2019-08-01 16:59:41.000000000 +0000
    +++ r-cran-afex-0.26-0/tests/testthat/test-aov_car-bugs.R	2020-01-15 18:19:28.000000000 +0000
    @@ -231,8 +231,8 @@
     
     
     test_that("aov_ez works with multiple covariates", {
    -  skip_if_not_installed("psych")
    -  require(psych)
    +  skip_if_not_installed("psychTools")
    +  require(psychTools)
       data(msq)
       msq2 <- msq[!is.na(msq$Extraversion),]
       msq2 <- droplevels(msq2[msq2$ID != "18",])
    diff -Nru r-cran-afex-0.25-1/vignettes/afex_plot_introduction.Rmd r-cran-afex-0.26-0/vignettes/afex_plot_introduction.Rmd
    --- r-cran-afex-0.25-1/vignettes/afex_plot_introduction.Rmd	2019-08-27 16:39:44.000000000 +0000
    +++ r-cran-afex-0.26-0/vignettes/afex_plot_introduction.Rmd	2020-01-15 20:56:03.000000000 +0000
    @@ -68,7 +68,7 @@
     
     ## Exploring Graphical Options and Themes
     
    -We now produce a new variant of the left plot using more appropriate error bars and change several other graphical details which make the plot publication ready. We use the ability of `afex_plot()` to rename the factor levels (for technical reasons the ANOVA functions in `afex` transform all factor levels to proper `R` variable names using `make.names()` which changed the labels from e.g., `4` to `X4`) and the title of the legend. We also change the labels on the `x` and `y` axis. 
    +We now produce a new variant of the left plot using more appropriate error bars and change several other graphical details which make the plot publication ready. We use the `factor_levels` argument to `afex_plot()` for renaming the factor levels (for technical reasons the ANOVA functions in `afex` transform all factor levels to proper `R` variable names using `make.names()` which changed the labels from e.g., `4` to `X4`) and the `legend_title` argument for changing the title of the legend. We also change the labels on the `x` and `y` axis. 
     
     
     ```{r}
    @@ -79,6 +79,7 @@
       labs(y = "RTs (in ms)", x = "Angle (in degrees)")
     ```
     
    +As the additional output shows, changing the factor levels via `factor_levels` emits a `message` detailing old and new factor levels in the form `old -> new`. This message can be suppressed by wrapping the `afex_plot()` call into a `suppressMessages()` call or via `RMarkdown` settings. Note that we could have also used the `factor_levels` argument for changing the order of the factor levels by passing a named character vector (e.g., `factor_levels = list(angle = c(X8 = "8°", X4 = "4°", X0 = "0°"))`). This would change the order either on the x-axis or in the legend.
     
     As said above, I am not a big fan of the default grey theme of `ggplot2` plots. Consequently, we compare a number of different themes for this plot in the following. For all but `ggpubr::theme_pubr()`, we also move the legend to the bottom as this better allows the plot to cover only a single column in a two-column layout. `ggpubr::theme_pubr()` automatically plots the legend on top.