metrumresearchgroup / pmplots

Plots for Pharmacometrics
https://metrumresearchgroup.github.io/pmplots
8 stars 1 forks source link

failures with ggplot2 3.5.0 #84

Closed kyleam closed 7 months ago

kyleam commented 7 months ago

When running R CMD check with the latest ggplot2 release (3.5.0), there are test, example, and vignette failures. At a glance, it appears they may all stem from the same source because I don't spot one without unused argument (alist(... = ). Example:

── 1. Error ('test-cat.R:12:3'): vector inputs for cont_cat [PMP-TEST-001] ─────
Error in `discrete_scale(aesthetics = c("x", "xmin", "xmax", "xend"), name = name,
    palette = identity, ..., expand = expand, guide = guide,
    position = position, super = ScaleDiscretePosition)`: unused argument (alist(... = ))
Backtrace:
    ▆
 1. └─pmplots::cont_cat(df, x, y[1]) at test-cat.R:12:3
 2.   └─pmplots::pm_box_list(df, x, y, xs = xs, ys = ys, ...)
 3.     └─pmplots::list_plot_xy(df, x, y, cont_cat, ...)
 4.       └─pmplots (local) .fun(df, x = x[i], y = y[j], ...)
 5.         └─pmplots::boxwork(df, x[1], y[1], xs, ys, ...)
 6.           ├─base::do.call("scale_x_discrete", xs)
 7.           └─ggplot2::scale_x_discrete(...)
check output ``` ── R CMD check ───────────────────────────────────────────────────────────────── * using log directory ‘/tmp/RtmpZrzuRe/filee122585baec5/pmplots.Rcheck’ * using R version 4.3.1 (2023-06-16) * using platform: x86_64-pc-linux-gnu (64-bit) * R was compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0 GNU Fortran (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0 * running under: Ubuntu 20.04.6 LTS * using session charset: UTF-8 * using option ‘--no-manual’ * checking for file ‘pmplots/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘pmplots’ version ‘0.4.0’ * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘pmplots’ can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking ‘build’ directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking installed files from ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK * checking examples ... ERROR Running examples in ‘pmplots-Ex.R’ failed The error most likely occurred in: > ### Name: cont_cat_panel > ### Title: Create a display of continuous versus categorical covariates > ### Aliases: cont_cat_panel cont_cat_panel_list > > ### ** Examples > > data <- pmplots_data_id() > cont <- c("WT//Weight (kg)", "ALB//Albumin (mg/dL)", "AGE//Age (years)") > cats <- c("RF//Renal function", "CPc//Child-Pugh") > > cont_cat_panel(data, x = cats, y = cont, tag_levels = "A") Error in discrete_scale(aesthetics = c("x", "xmin", "xmax", "xend"), name = name, : unused argument (alist(... = )) Calls: cont_cat_panel ... list_plot_xy -> .fun -> boxwork -> do.call -> scale_x_discrete Execution halted * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... Running ‘testthat.R’ ERROR Running the tests in ‘tests/testthat.R’ failed. Last 13 lines of output: 4. └─pmplots::pm_box_list(df, x, y, xs = xs, ys = ys, ...) 5. └─pmplots::list_plot_xy(df, x, y, cont_cat, ...) 6. └─pmplots (local) .fun(df, x = x[i], y = y[j], ...) 7. └─pmplots::boxwork(df, x[1], y[1], xs, ys, ...) 8. ├─base::do.call("scale_x_discrete", xs) 9. └─ggplot2::scale_x_discrete(...) ... and 26 more Maximum number of 10 failures reached, some test results may be missing. ══ DONE ════════════════════════════════════════════════════════════════════════ Keep trying! Error: Test failures Execution halted * checking for unstated dependencies in vignettes ... OK * checking package vignettes in ‘inst/doc’ ... OK * checking running R code from vignettes ... ‘col-label.Rmd’ using ‘UTF-8’... OK ‘customize.Rmd’ using ‘UTF-8’... OK ‘diagnostic-displays.Rmd’ using ‘UTF-8’... OK ‘dv.Rmd’ using ‘UTF-8’... OK ‘eta.Rmd’ using ‘UTF-8’... OK ‘list_plots.Rmd’ using ‘UTF-8’... OK ‘npde_plots.Rmd’ using ‘UTF-8’... OK ‘pmplots.Rmd’ using ‘UTF-8’... OK ‘residual_plots.Rmd’ using ‘UTF-8’... OK ‘wrapped_plots.Rmd’ using ‘UTF-8’... OK NONE * checking re-building of vignette outputs ... ERROR Error(s) in re-building vignettes: --- re-building ‘col-label.Rmd’ using rmarkdown Quitting from lines 67-68 [unnamed-chunk-7] (col-label.Rmd) Error: processing vignette 'col-label.Rmd' failed with diagnostics: 'match' requires vector arguments --- failed re-building ‘col-label.Rmd’ --- re-building ‘customize.Rmd’ using rmarkdown Quitting from lines 25-26 [unnamed-chunk-2] (customize.Rmd) Error: processing vignette 'customize.Rmd' failed with diagnostics: 'match' requires vector arguments --- failed re-building ‘customize.Rmd’ --- re-building ‘diagnostic-displays.Rmd’ using rmarkdown Quitting from lines 52-59 [unnamed-chunk-3] (diagnostic-displays.Rmd) Error: processing vignette 'diagnostic-displays.Rmd' failed with diagnostics: unused argument (alist(... = )) --- failed re-building ‘diagnostic-displays.Rmd’ --- re-building ‘dv.Rmd’ using rmarkdown Quitting from lines 26-27 [unnamed-chunk-2] (dv.Rmd) Error: processing vignette 'dv.Rmd' failed with diagnostics: 'match' requires vector arguments --- failed re-building ‘dv.Rmd’ --- re-building ‘eta.Rmd’ using rmarkdown Quitting from lines 51-52 [unnamed-chunk-5] (eta.Rmd) Error: processing vignette 'eta.Rmd' failed with diagnostics: unused argument (alist(... = )) --- failed re-building ‘eta.Rmd’ --- re-building ‘list_plots.Rmd’ using rmarkdown Quitting from lines 74-75 [unnamed-chunk-6] (list_plots.Rmd) Error: processing vignette 'list_plots.Rmd' failed with diagnostics: unused argument (alist(... = )) --- failed re-building ‘list_plots.Rmd’ --- re-building ‘npde_plots.Rmd’ using rmarkdown Quitting from lines 52-53 [unnamed-chunk-6] (npde_plots.Rmd) Error: processing vignette 'npde_plots.Rmd' failed with diagnostics: unused argument (alist(... = )) --- failed re-building ‘npde_plots.Rmd’ --- re-building ‘pmplots.Rmd’ using rmarkdown Quitting from lines 52-53 [unnamed-chunk-5] (pmplots.Rmd) Error: processing vignette 'pmplots.Rmd' failed with diagnostics: 'match' requires vector arguments --- failed re-building ‘pmplots.Rmd’ --- re-building ‘residual_plots.Rmd’ using rmarkdown Quitting from lines 60-61 [unnamed-chunk-6] (residual_plots.Rmd) Error: processing vignette 'residual_plots.Rmd' failed with diagnostics: unused argument (alist(... = )) --- failed re-building ‘residual_plots.Rmd’ --- re-building ‘wrapped_plots.Rmd’ using rmarkdown Quitting from lines 89-90 [unnamed-chunk-7] (wrapped_plots.Rmd) Error: processing vignette 'wrapped_plots.Rmd' failed with diagnostics: 'match' requires vector arguments --- failed re-building ‘wrapped_plots.Rmd’ SUMMARY: processing the following files failed: ‘col-label.Rmd’ ‘customize.Rmd’ ‘diagnostic-displays.Rmd’ ‘dv.Rmd’ ‘eta.Rmd’ ‘list_plots.Rmd’ ‘npde_plots.Rmd’ ‘pmplots.Rmd’ ‘residual_plots.Rmd’ ‘wrapped_plots.Rmd’ Error: Vignette re-building failed. Execution halted * DONE Status: 3 ERRORs See ‘/tmp/RtmpZrzuRe/filee122585baec5/pmplots.Rcheck/00check.log’ for details. ── R CMD check results ────────────────────────────────────── pmplots 0.4.0 ──── Duration: 1m 22.5s ❯ checking examples ... ERROR Running examples in ‘pmplots-Ex.R’ failed The error most likely occurred in: > ### Name: cont_cat_panel > ### Title: Create a display of continuous versus categorical covariates > ### Aliases: cont_cat_panel cont_cat_panel_list > > ### ** Examples > > data <- pmplots_data_id() > cont <- c("WT//Weight (kg)", "ALB//Albumin (mg/dL)", "AGE//Age (years)") > cats <- c("RF//Renal function", "CPc//Child-Pugh") > > cont_cat_panel(data, x = cats, y = cont, tag_levels = "A") Error in discrete_scale(aesthetics = c("x", "xmin", "xmax", "xend"), name = name, : unused argument (alist(... = )) Calls: cont_cat_panel ... list_plot_xy -> .fun -> boxwork -> do.call -> scale_x_discrete Execution halted ❯ checking tests ... See below... ❯ checking re-building of vignette outputs ... ERROR Error(s) in re-building vignettes: --- re-building ‘col-label.Rmd’ using rmarkdown Quitting from lines 67-68 [unnamed-chunk-7] (col-label.Rmd) Error: processing vignette 'col-label.Rmd' failed with diagnostics: 'match' requires vector arguments --- failed re-building ‘col-label.Rmd’ --- re-building ‘customize.Rmd’ using rmarkdown Quitting from lines 25-26 [unnamed-chunk-2] (customize.Rmd) Error: processing vignette 'customize.Rmd' failed with diagnostics: 'match' requires vector arguments --- failed re-building ‘customize.Rmd’ --- re-building ‘diagnostic-displays.Rmd’ using rmarkdown Quitting from lines 52-59 [unnamed-chunk-3] (diagnostic-displays.Rmd) Error: processing vignette 'diagnostic-displays.Rmd' failed with diagnostics: unused argument (alist(... = )) --- failed re-building ‘diagnostic-displays.Rmd’ --- re-building ‘dv.Rmd’ using rmarkdown Quitting from lines 26-27 [unnamed-chunk-2] (dv.Rmd) Error: processing vignette 'dv.Rmd' failed with diagnostics: 'match' requires vector arguments --- failed re-building ‘dv.Rmd’ --- re-building ‘eta.Rmd’ using rmarkdown Quitting from lines 51-52 [unnamed-chunk-5] (eta.Rmd) Error: processing vignette 'eta.Rmd' failed with diagnostics: unused argument (alist(... = )) --- failed re-building ‘eta.Rmd’ --- re-building ‘list_plots.Rmd’ using rmarkdown Quitting from lines 74-75 [unnamed-chunk-6] (list_plots.Rmd) Error: processing vignette 'list_plots.Rmd' failed with diagnostics: unused argument (alist(... = )) --- failed re-building ‘list_plots.Rmd’ --- re-building ‘npde_plots.Rmd’ using rmarkdown Quitting from lines 52-53 [unnamed-chunk-6] (npde_plots.Rmd) Error: processing vignette 'npde_plots.Rmd' failed with diagnostics: unused argument (alist(... = )) --- failed re-building ‘npde_plots.Rmd’ --- re-building ‘pmplots.Rmd’ using rmarkdown Quitting from lines 52-53 [unnamed-chunk-5] (pmplots.Rmd) Error: processing vignette 'pmplots.Rmd' failed with diagnostics: 'match' requires vector arguments --- failed re-building ‘pmplots.Rmd’ --- re-building ‘residual_plots.Rmd’ using rmarkdown Quitting from lines 60-61 [unnamed-chunk-6] (residual_plots.Rmd) Error: processing vignette 'residual_plots.Rmd' failed with diagnostics: unused argument (alist(... = )) --- failed re-building ‘residual_plots.Rmd’ --- re-building ‘wrapped_plots.Rmd’ using rmarkdown Quitting from lines 89-90 [unnamed-chunk-7] (wrapped_plots.Rmd) Error: processing vignette 'wrapped_plots.Rmd' failed with diagnostics: 'match' requires vector arguments --- failed re-building ‘wrapped_plots.Rmd’ SUMMARY: processing the following files failed: ‘col-label.Rmd’ ‘customize.Rmd’ ‘diagnostic-displays.Rmd’ ‘dv.Rmd’ ‘eta.Rmd’ ‘list_plots.Rmd’ ‘npde_plots.Rmd’ ‘pmplots.Rmd’ ‘residual_plots.Rmd’ ‘wrapped_plots.Rmd’ Error: Vignette re-building failed. Execution halted ── Test failures ───────────────────────────────────────────────── testthat ──── > Sys.setenv("R_TESTS" = "") > library(testthat) > library(pmplots) Loading required package: ggplot2 > > test_check("pmplots", reporter="summary") cat: test-cat: 123 chunk: chunk data sets: .... col_label: test-col_label: ................. cont: test-cont: 4 data: test-data: ... displays: 56789abcdefg.......................hijk dv-pred-ipred: test-dv-pred-ipred: ............................... layer: test-layer: l list_plot: test-layer: m opts: test-opts: .............. pairs: test-pairs: ............. pm-axis: test-pm-axis: ............... pm: test-pm: nop..................q.....r............................................. pm_browser: required: test-required: ...s..... res_time: test-pm: ............................................. scatter: test-scatter: ...t split_plot: test-split_plot: uvw..x utils: test-utils: y wrap: test-wrap: ...........z.A ══ Failed ══════════════════════════════════════════════════════════════════════ ── 1. Error ('test-cat.R:12:3'): vector inputs for cont_cat [PMP-TEST-001] ───── Error in `discrete_scale(aesthetics = c("x", "xmin", "xmax", "xend"), name = name, palette = identity, ..., expand = expand, guide = guide, position = position, super = ScaleDiscretePosition)`: unused argument (alist(... = )) Backtrace: ▆ 1. └─pmplots::cont_cat(df, x, y[1]) at test-cat.R:12:3 2. └─pmplots::pm_box_list(df, x, y, xs = xs, ys = ys, ...) 3. └─pmplots::list_plot_xy(df, x, y, cont_cat, ...) 4. └─pmplots (local) .fun(df, x = x[i], y = y[j], ...) 5. └─pmplots::boxwork(df, x[1], y[1], xs, ys, ...) 6. ├─base::do.call("scale_x_discrete", xs) 7. └─ggplot2::scale_x_discrete(...) ── 2. Error ('test-cat.R:22:3'): cont_cat jitters points in x-direction only [PM Error in `discrete_scale(aesthetics = c("x", "xmin", "xmax", "xend"), name = name, palette = identity, ..., expand = expand, guide = guide, position = position, super = ScaleDiscretePosition)`: unused argument (alist(... = )) Backtrace: ▆ 1. └─pmplots::cont_cat(id, x = "STUDYc", y = "WT", points = TRUE) at test-cat.R:22:3 2. └─pmplots::boxwork(df, x[1], y[1], xs, ys, ...) 3. ├─base::do.call("scale_x_discrete", xs) 4. └─ggplot2::scale_x_discrete(...) ── 3. Error ('test-cat.R:28:3'): points on top of box plot issue-13 [PMP-TEST-00 Error in `discrete_scale(aesthetics = c("x", "xmin", "xmax", "xend"), name = name, palette = identity, ..., expand = expand, guide = guide, position = position, super = ScaleDiscretePosition)`: unused argument (alist(... = )) Backtrace: ▆ 1. └─pmplots::cont_cat(id, y = "WT", x = "STUDYc") at test-cat.R:28:3 2. └─pmplots::boxwork(df, x[1], y[1], xs, ys, ...) 3. ├─base::do.call("scale_x_discrete", xs) 4. └─ggplot2::scale_x_discrete(...) ── 4. Error ('test-cont.R:8:3'): scatter plot IDs [PMP-TEST-007] ─────────────── Error in `match(x, table, nomatch = 0L)`: 'match' requires vector arguments Backtrace: ▆ 1. └─pmplots::dv_pred(df, plot_id = TRUE, group = "ID", size = 4) at test-cont.R:8:3 2. └─xs$trans %in% c("log", "log10") ── 5. Error ('test-displays.R:21:3'): eta_covariate ──────────────────────────── Error in `discrete_scale(aesthetics = c("x", "xmin", "xmax", "xend"), name = name, palette = identity, ..., expand = expand, guide = guide, position = position, super = ScaleDiscretePosition)`: unused argument (alist(... = )) Backtrace: ▆ 1. └─pmplots::eta_covariate(data, covs, etas) at test-displays.R:21:3 2. └─pmplots::eta_covariate_list(df, x, y, transpose) 3. └─pmplots:::diagnostic_display_list(df, x, y, eta_cat, eta_cont) 4. └─base::lapply(...) 5. └─pmplots (local) FUN(X[[i]], ...) 6. └─pmplots (local) fun_cat(df, x = x[ii], y = y[i]) 7. └─pmplots::list_plot_xy(...) 8. └─pmplots (local) .fun(df, x = x[i], y = y[j], ...) 9. └─pmplots::boxwork(df, x[1], y[1], xs, ys, ...) 10. ├─base::do.call("scale_x_discrete", xs) 11. └─ggplot2::scale_x_discrete(...) ── 6. Error ('test-displays.R:31:3'): cont_cat_panel ─────────────────────────── Error in `discrete_scale(aesthetics = c("x", "xmin", "xmax", "xend"), name = name, palette = identity, ..., expand = expand, guide = guide, position = position, super = ScaleDiscretePosition)`: unused argument (alist(... = )) Backtrace: ▆ 1. └─pmplots::cont_cat_panel(data, x = cats, y = cont) at test-displays.R:31:3 2. └─pmplots::cont_cat_panel_list(df, x, y, transpose, ...) 3. └─pmplots::list_plot_y(df, x, y, .fun = cont_cat, ...) 4. └─pmplots (local) .fun(df = df, x = x, y = y[i], ...) 5. └─pmplots::pm_box_list(df, x, y, xs = xs, ys = ys, ...) 6. └─pmplots::list_plot_xy(df, x, y, cont_cat, ...) 7. └─pmplots (local) .fun(df, x = x[i], y = y[j], ...) 8. └─pmplots::boxwork(df, x[1], y[1], xs, ys, ...) 9. ├─base::do.call("scale_x_discrete", xs) 10. └─ggplot2::scale_x_discrete(...) ── 7. Error ('test-displays.R:41:3'): npde_covariate ─────────────────────────── Error in `discrete_scale(aesthetics = c("x", "xmin", "xmax", "xend"), name = name, palette = identity, ..., expand = expand, guide = guide, position = position, super = ScaleDiscretePosition)`: unused argument (alist(... = )) Backtrace: ▆ 1. └─pmplots::npde_covariate(data, covs) at test-displays.R:41:3 2. └─pmplots::npde_covariate_list(df, x) 3. └─pmplots:::diagnostic_display_list(...) 4. └─base::lapply(...) 5. └─pmplots (local) FUN(X[[i]], ...) 6. └─pmplots (local) fun_cat(df, x = x[ii], y = y[i]) 7. └─pmplots::res_cat(df, x, y, ...) 8. └─pmplots::list_plot_xy(...) 9. └─pmplots (local) .fun(df, x = x[i], y = y[j], ...) 10. └─pmplots::boxwork(df, x[1], y[1], xs, ys, ...) 11. ├─base::do.call("scale_x_discrete", xs) 12. └─ggplot2::scale_x_discrete(...) ── 8. Error ('test-displays.R:47:3'): cwres_covariate ────────────────────────── Error in `discrete_scale(aesthetics = c("x", "xmin", "xmax", "xend"), name = name, palette = identity, ..., expand = expand, guide = guide, position = position, super = ScaleDiscretePosition)`: unused argument (alist(... = )) Backtrace: ▆ 1. └─pmplots::cwres_covariate(data, covs) at test-displays.R:47:3 2. └─pmplots::cwres_covariate_list(df, x) 3. └─pmplots:::diagnostic_display_list(...) 4. └─base::lapply(...) 5. └─pmplots (local) FUN(X[[i]], ...) 6. └─pmplots (local) fun_cat(df, x = x[ii], y = y[i]) 7. └─pmplots::res_cat(df, x, y, hline, ...) 8. └─pmplots::list_plot_xy(...) 9. └─pmplots (local) .fun(df, x = x[i], y = y[j], ...) 10. └─pmplots::boxwork(df, x[1], y[1], xs, ys, ...) 11. ├─base::do.call("scale_x_discrete", xs) 12. └─ggplot2::scale_x_discrete(...) ── 9. Error ('test-displays.R:53:3'): eta_covariate_list ─────────────────────── Error in `discrete_scale(aesthetics = c("x", "xmin", "xmax", "xend"), name = name, palette = identity, ..., expand = expand, guide = guide, position = position, super = ScaleDiscretePosition)`: unused argument (alist(... = )) Backtrace: ▆ 1. └─pmplots::eta_covariate_list(data, covs, etas) at test-displays.R:53:3 2. └─pmplots:::diagnostic_display_list(df, x, y, eta_cat, eta_cont) 3. └─base::lapply(...) 4. └─pmplots (local) FUN(X[[i]], ...) 5. └─pmplots (local) fun_cat(df, x = x[ii], y = y[i]) 6. └─pmplots::list_plot_xy(...) 7. └─pmplots (local) .fun(df, x = x[i], y = y[j], ...) 8. └─pmplots::boxwork(df, x[1], y[1], xs, ys, ...) 9. ├─base::do.call("scale_x_discrete", xs) 10. └─ggplot2::scale_x_discrete(...) ── 10. Error ('test-displays.R:67:3'): cont_cat_panel_list ───────────────────── Error in `discrete_scale(aesthetics = c("x", "xmin", "xmax", "xend"), name = name, palette = identity, ..., expand = expand, guide = guide, position = position, super = ScaleDiscretePosition)`: unused argument (alist(... = )) Backtrace: ▆ 1. └─pmplots::cont_cat_panel_list(data, cats, cont) at test-displays.R:67:3 2. └─pmplots::list_plot_y(df, x, y, .fun = cont_cat, ...) 3. └─pmplots (local) .fun(df = df, x = x, y = y[i], ...) 4. └─pmplots::pm_box_list(df, x, y, xs = xs, ys = ys, ...) 5. └─pmplots::list_plot_xy(df, x, y, cont_cat, ...) 6. └─pmplots (local) .fun(df, x = x[i], y = y[j], ...) 7. └─pmplots::boxwork(df, x[1], y[1], xs, ys, ...) 8. ├─base::do.call("scale_x_discrete", xs) 9. └─ggplot2::scale_x_discrete(...) ... and 26 more Maximum number of 10 failures reached, some test results may be missing. ══ DONE ════════════════════════════════════════════════════════════════════════ Keep trying! Error: Test failures Execution halted 3 errors ✖ | 0 warnings ✔ | 0 notes ✔ ```
kyleam commented 7 months ago

I've started to look into this. There are a couple of things going on here. I'll post a PR later today or tomorrow.