bschilder / ThreeWayTest

Summary statistics-based association test for identifying the pleiotropic effects with set of genetic variants
2 stars 1 forks source link

`ggnetwork` error: `Error in `if (stringsAsFactors) x <- factor(x)`: argument is of length zero` #20

Closed bschilder closed 1 year ago

bschilder commented 1 year ago

1. Bug description

ThreeWayTest:::networkmap_ggnetwork fails only on Linux GHA machine. I've noticed this with other packages of mine recently and I think it has to do with some recent changes to ggnetwork package. Will sort this out since I need to figure it out for my other packages anyways.

https://github.com/bschilder/ThreeWayTest/actions/runs/4363979376/jobs/7630734336#step:4:1172# Console output

https://github.com/bschilder/ThreeWayTest/actions/runs/4363979376/jobs/7630734336#step:4:1172

── Test failures ───────────────────────────────────────────────── testthat ────

> desc_path <- list.files("../","^DESCRIPTION$",
+                         full.names = TRUE, recursive = TRUE)[1]
> pkg <- read.dcf(desc_path, fields = "Package")[1]
> library(testthat)
> library(pkg, character.only = TRUE)
> 
> test_check(pkg)
Loading required namespace: heatmaply
Loading required namespace: tidygraph
Loading required namespace: ggnetwork
Loading required namespace: pals
[ FAIL 1 | WARN 0 | SKIP 0 | PASS 9 ]

══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-networkmap.R:4'): networkmap works ─────────────────────────────
Error in `if (stringsAsFactors) x <- factor(x)`: argument is of length zero
Backtrace:
     ▆
  1. └─ThreeWayTest::networkmap(dat = dat) at test-networkmap.R:4:4
  2.   └─ThreeWayTest:::networkmap_ggnetwork(...)
  3.     ├─base::suppressWarnings(ggnetwork::fortify(ig, list(layout = "graphopt")))
  4.     │ └─base::withCallingHandlers(...)
  5.     ├─ggnetwork::fortify(ig, list(layout = "graphopt"))
  6.     └─ggnetwork:::fortify.igraph(ig, list(layout = "graphopt"))
  7.       └─ggnetwork:::format_fortify(...)
  8.         └─base::cbind.data.frame(...)
  9.           └─base::data.frame(..., check.names = FALSE)
 10.             ├─base::as.data.frame(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors)
 11.             └─base::as.data.frame.list(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors)
 12.               ├─base::do.call(data.frame, c(x, alis))
 13.               └─base (local) `<fn>`(...)
 14.                 ├─base::as.data.frame(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors)
 15.                 └─base::as.data.frame.character(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors)

[ FAIL 1 | WARN 0 | SKIP 0 | PASS 9 ]
Error: Test failures
Execution halted

2 errors ✖ | 0 warnings ✔ | 1 note ✖

Expected behaviour

Runs with no errors.

2. Reproducible example

Error in if (stringsAsFactors) x <- factor(x): argument is of length zero

3. Session info

https://github.com/bschilder/ThreeWayTest/actions/runs/4363979376/jobs/7630734336#step:4:761

``` ─ Session info ─────────────────────────────────────────────────────────────────────────────────── setting value version R Under development (unstable) (2023-03-02 r83926) os Ubuntu 22.04.2 LTS system x86_64, linux-gnu ui X11 language (EN) collate en_US.UTF-8 ctype en_US.UTF-8 tz UTC date 2023-03-08 pandoc 2.19.2 @ /usr/local/bin/pandoc ─ Packages ─────────────────────────────────────────────────────────────────────────────────────── package * version date (UTC) lib source askpass 1.1 2019-01-13 [1] CRAN (R 4.3.0) assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.3.0) badger 0.2.3 2023-01-28 [1] CRAN (R 4.3.0) base * 4.3.0 2023-03-03 [3] local base64enc 0.1-3 2015-07-28 [1] CRAN (R 4.3.0) BH 1.81.0-1 2023-01-22 [1] CRAN (R 4.3.0) Biobase 2.59.0 2022-11-01 [1] Bioconductor BiocCheck 1.35.12 2023-02-27 [1] any (@1.35.12) BiocFileCache 2.7.2 2023-02-17 [1] Bioconductor BiocGenerics 0.45.0 2022-11-01 [1] Bioconductor BiocManager 1.30.20 2023-02-24 [1] CRAN (R 4.3.0) BiocVersion 3.17.1 2022-11-04 [2] Bioconductor biocViews 1.67.2 2022-12-22 [1] Bioconductor bit 4.0.5 2022-11-15 [1] CRAN (R 4.3.0) bit64 4.0.5 2020-08-30 [1] CRAN (R 4.3.0) bitops 1.0-7 2021-04-24 [1] CRAN (R 4.3.0) blob 1.2.3 2022-04-10 [1] CRAN (R 4.3.0) boot 1.3-28.1 2022-11-22 [3] CRAN (R 4.3.0) brew 1.0-8 2022-09-29 [2] CRAN (R 4.3.0) brio 1.1.3 2021-11-30 [1] CRAN (R 4.3.0) bslib 0.4.2 2022-12-16 [1] CRAN (R 4.3.0) ca 0.71.1 2020-01-24 [1] CRAN (R 4.3.0) cachem 1.0.7 2023-02-24 [1] CRAN (R 4.3.0) callr 3.7.3 2022-11-02 [1] CRAN (R 4.3.0) class 7.3-21 2023-01-23 [3] CRAN (R 4.3.0) cli 3.6.0 2023-01-09 [1] CRAN (R 4.3.0) clipr 0.8.0 2022-02-22 [1] CRAN (R 4.3.0) cluster 2.1.4 2022-08-22 [3] CRAN (R 4.3.0) coda 0.19-4 2020-09-30 [1] CRAN (R 4.3.0) codetools 0.2-19 2023-02-01 [3] CRAN (R 4.3.0) colorspace 2.1-0 2023-01-23 [1] CRAN (R 4.3.0) commonmark 1.8.1 2022-10-14 [1] CRAN (R 4.3.0) compiler 4.3.0 2023-03-03 [3] local covr 3.6.1 2022-08-26 [1] CRAN (R 4.3.0) cpp11 0.4.3 2022-10-12 [1] CRAN (R 4.3.0) crayon 1.5.2 2022-09-29 [1] CRAN (R 4.3.0) credentials 1.3.2 2021-11-29 [1] CRAN (R 4.3.0) crosstalk 1.2.0 2021-11-04 [1] CRAN (R 4.3.0) curl 5.0.0 2023-01-12 [1] CRAN (R 4.3.0) data.table 1.14.8 2023-02-17 [1] CRAN (R 4.3.0) datasets * 4.3.0 2023-03-03 [3] local DBI 1.1.3 2022-06-18 [1] CRAN (R 4.3.0) dbplyr 2.3.1 2023-02-24 [1] CRAN (R 4.3.0) dendextend 1.16.0 2022-07-04 [1] CRAN (R 4.3.0) desc 1.4.2 2022-09-08 [1] CRAN (R 4.3.0) devtools 2.4.5 2022-10-11 [2] CRAN (R 4.3.0) dichromat 2.0-0.1 2022-05-02 [1] CRAN (R 4.3.0) diffobj 0.3.5 2021-10-05 [1] CRAN (R 4.3.0) digest 0.6.31 2022-12-11 [1] CRAN (R 4.3.0) dlstats 0.1.6 2022-12-09 [1] CRAN (R 4.3.0) docopt 0.7.1 2020-06-24 [2] CRAN (R 4.3.0) downlit 0.4.2 2022-07-05 [2] CRAN (R 4.3.0) dplyr 1.1.0 2023-01-29 [1] CRAN (R 4.3.0) egg 0.4.5 2019-07-13 [1] CRAN (R 4.3.0) ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.3.0) evaluate 0.20 2023-01-17 [1] CRAN (R 4.3.0) fansi 1.0.4 2023-01-22 [1] CRAN (R 4.3.0) farver 2.1.1 2022-07-06 [1] CRAN (R 4.3.0) fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.3.0) filelock 1.0.2 2018-10-05 [1] CRAN (R 4.3.0) fontawesome 0.5.0 2023-01-25 [2] CRAN (R 4.3.0) foreach 1.5.2 2022-02-02 [1] CRAN (R 4.3.0) foreign 0.8-84 2022-12-06 [3] CRAN (R 4.3.0) fs 1.6.1 2023-02-06 [1] CRAN (R 4.3.0) gclus 1.3.2 2019-01-07 [1] CRAN (R 4.3.0) generics 0.1.3 2022-07-05 [1] CRAN (R 4.3.0) gert 1.9.2 2022-12-05 [1] CRAN (R 4.3.0) ggnetwork 0.5.10 2021-07-06 [1] CRAN (R 4.3.0) ggplot2 3.4.1 2023-02-10 [1] CRAN (R 4.3.0) ggrepel 0.9.3 2023-02-03 [1] CRAN (R 4.3.0) gh 1.4.0 2023-02-22 [1] CRAN (R 4.3.0) gitcreds 0.1.2 2022-09-08 [1] CRAN (R 4.3.0) glue 1.6.2 2022-02-24 [1] CRAN (R 4.3.0) graph 1.77.2 2023-02-24 [1] Bioconductor graphics * 4.3.0 2023-03-03 [3] local grDevices * 4.3.0 2023-03-03 [3] local grid 4.3.0 2023-03-03 [3] local gridExtra 2.3 2017-09-09 [1] CRAN (R 4.3.0) gtable 0.3.1 2022-09-01 [1] CRAN (R 4.3.0) heatmaply 1.4.2 2023-01-07 [1] CRAN (R 4.3.0) here 1.0.1 2020-12-13 [1] CRAN (R 4.3.0) highr 0.10 2022-12-22 [1] CRAN (R 4.3.0) htmltools 0.5.4 2022-12-07 [1] CRAN (R 4.3.0) htmlwidgets 1.6.1 2023-01-07 [1] CRAN (R 4.3.0) httpuv 1.6.9 2023-02-14 [2] CRAN (R 4.3.0) httr 1.4.5 2023-02-24 [1] CRAN (R 4.3.0) httr2 0.2.2 2022-09-25 [1] CRAN (R 4.3.0) igraph 1.4.1 2023-02-24 [1] CRAN (R 4.3.0) ini 0.3.1 2018-05-20 [1] CRAN (R 4.3.0) isoband 0.2.7 2022-12-20 [1] CRAN (R 4.3.0) iterators 1.0.14 2022-02-05 [1] CRAN (R 4.3.0) jquerylib 0.1.4 2021-04-26 [1] CRAN (R 4.3.0) jsonlite 1.8.4 2022-12-06 [1] CRAN (R 4.3.0) KernSmooth 2.23-20 2021-05-03 [3] CRAN (R 4.3.0) knitr 1.42 2023-01-25 [1] CRAN (R 4.3.0) labeling 0.4.2 2020-10-20 [1] CRAN (R 4.3.0) later 1.3.0 2021-08-18 [1] CRAN (R 4.3.0) lattice 0.20-45 2021-09-22 [3] CRAN (R 4.3.0) lazyeval 0.2.2 2019-03-15 [1] CRAN (R 4.3.0) lifecycle 1.0.3 2022-10-07 [1] CRAN (R 4.3.0) littler 0.3.17 2022-10-29 [2] CRAN (R 4.3.0) magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.3.0) mapproj 1.2.11 2023-01-12 [1] CRAN (R 4.3.0) maps 3.4.1 2022-10-30 [1] CRAN (R 4.3.0) markdown 1.5 2023-01-31 [1] CRAN (R 4.3.0) MASS 7.3-58.2 2023-01-23 [3] CRAN (R 4.3.0) Matrix 1.5-3 2022-11-11 [3] CRAN (R 4.3.0) memoise 2.0.1 2021-11-26 [1] CRAN (R 4.3.0) methods * 4.3.0 2023-03-03 [3] local mgcv 1.8-42 2023-03-02 [3] CRAN (R 4.3.0) mime 0.12 2021-09-28 [1] CRAN (R 4.3.0) miniUI 0.1.1.1 2018-05-18 [2] CRAN (R 4.3.0) munsell 0.5.0 2018-06-12 [1] CRAN (R 4.3.0) network 1.18.1 2023-01-24 [1] CRAN (R 4.3.0) nlme 3.1-162 2023-01-31 [3] CRAN (R 4.3.0) nnet 7.3-18 2022-09-28 [3] CRAN (R 4.3.0) openssl 2.0.5 2022-12-06 [1] CRAN (R 4.3.0) pals 1.7 2021-04-17 [1] CRAN (R 4.3.0) parallel 4.3.0 2023-03-03 [3] local pillar 1.8.1 2022-08-19 [1] CRAN (R 4.3.0) pkgbuild 1.4.0 2022-11-27 [1] CRAN (R 4.3.0) pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.3.0) pkgdown 2.0.7 2022-12-14 [1] CRAN (R 4.3.0) pkgload 1.3.2 2022-11-16 [1] CRAN (R 4.3.0) plogr 0.2.0 2018-03-25 [1] CRAN (R 4.3.0) plotly 4.10.1 2022-11-07 [1] CRAN (R 4.3.0) plyr 1.8.8 2022-11-11 [1] CRAN (R 4.3.0) praise 1.0.0 2015-08-11 [1] CRAN (R 4.3.0) prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.3.0) processx 3.8.0 2022-10-26 [1] CRAN (R 4.3.0) profvis 0.3.7 2020-11-02 [2] CRAN (R 4.3.0) promises 1.2.0.1 2021-02-11 [1] CRAN (R 4.3.0) ps 1.7.2 2022-10-26 [1] CRAN (R 4.3.0) purrr 1.0.1 2023-01-10 [1] CRAN (R 4.3.0) qap 0.1-2 2022-06-27 [1] CRAN (R 4.3.0) R6 2.5.1 2021-08-19 [1] CRAN (R 4.3.0) ragg 1.2.5 2023-01-12 [2] CRAN (R 4.3.0) rappdirs 0.3.3 2021-01-31 [1] CRAN (R 4.3.0) RBGL 1.75.0 2022-11-01 [1] Bioconductor rcmdcheck 1.4.0 2021-09-27 [1] any (@1.4.0) RColorBrewer 1.1-3 2022-04-03 [1] CRAN (R 4.3.0) Rcpp 1.0.10 2023-01-22 [1] CRAN (R 4.3.0) RCurl 1.98-1.10 2023-01-27 [1] CRAN (R 4.3.0) registry 0.5-1 2019-03-05 [1] CRAN (R 4.3.0) rematch2 2.1.2 2020-05-01 [1] CRAN (R 4.3.0) remotes 2.4.2 2021-11-30 [1] CRAN (R 4.3.0) reshape2 1.4.4 2020-04-09 [1] CRAN (R 4.3.0) rex 1.2.1 2021-11-26 [1] CRAN (R 4.3.0) rlang 1.0.6 2022-09-24 [1] CRAN (R 4.3.0) rmarkdown 2.20 2023-01-19 [1] CRAN (R 4.3.0) roxygen2 7.2.3 2022-12-08 [2] CRAN (R 4.3.0) rpart 4.1.19 2022-10-21 [3] CRAN (R 4.3.0) rprojroot 2.0.3 2022-04-02 [1] CRAN (R 4.3.0) RSQLite 2.3.0 2023-02-17 [1] CRAN (R 4.3.0) rstudioapi 0.14 2022-08-22 [1] CRAN (R 4.3.0) RUnit 0.4.32 2018-05-18 [1] CRAN (R 4.3.0) rvcheck 0.2.1 2021-10-22 [1] CRAN (R 4.3.0) rversions 2.1.2 2022-08-31 [2] CRAN (R 4.3.0) rworkflows 0.99.5 2023-01-12 [1] CRAN (R 4.3.0) sass 0.4.5 2023-01-24 [1] CRAN (R 4.3.0) scales 1.2.1 2022-08-20 [1] CRAN (R 4.3.0) seriation 1.4.1 2023-01-07 [1] CRAN (R 4.3.0) sessioninfo * 1.2.2 2021-12-06 [1] any (@1.2.2) shiny 1.7.4 2022-12-15 [2] CRAN (R 4.3.0) sna 2.7-1 2023-01-24 [1] CRAN (R 4.3.0) sourcetools 0.1.7-1 2023-02-01 [2] CRAN (R 4.3.0) spatial 7.3-16 2023-01-23 [3] CRAN (R 4.3.0) splines 4.3.0 2023-03-03 [3] local statnet.common 4.8.0 2023-01-24 [1] CRAN (R 4.3.0) stats * 4.3.0 2023-03-03 [3] local stats4 4.3.0 2023-03-03 [3] local stringdist 0.9.10 2022-11-07 [1] CRAN (R 4.3.0) stringi 1.7.12 2023-01-11 [1] CRAN (R 4.3.0) stringr 1.5.0 2022-12-02 [1] CRAN (R 4.3.0) survival 3.5-3 2023-02-12 [3] CRAN (R 4.3.0) sys 3.4.1 2022-10-18 [1] CRAN (R 4.3.0) systemfonts 1.0.4 2022-02-11 [2] CRAN (R 4.3.0) tcltk 4.3.0 2023-03-03 [3] local testthat 3.1.6 2022-12-09 [1] CRAN (R 4.3.0) textshaping 0.3.6 2021-10-13 [2] CRAN (R 4.3.0) ThreeWayTest 1.0.1 2023-03-03 [1] local tibble 3.1.8 2022-07-22 [1] CRAN (R 4.3.0) tidygraph 1.2.3 2023-02-01 [1] CRAN (R 4.3.0) tidyr 1.3.0 2023-01-24 [1] CRAN (R 4.3.0) tidyselect 1.2.0 2022-10-10 [1] CRAN (R 4.3.0) tinytex 0.44 2023-02-01 [1] CRAN (R 4.3.0) tools 4.3.0 2023-03-03 [3] local TSP 1.2-2 2023-01-25 [1] CRAN (R 4.3.0) urlchecker 1.0.1 2021-11-30 [2] CRAN (R 4.3.0) usethis 2.1.6 2022-05-25 [1] CRAN (R 4.3.0) utf8 1.2.3 2023-01-31 [1] CRAN (R 4.3.0) utils * 4.3.0 2023-03-03 [3] local vctrs 0.5.2 2023-01-23 [1] CRAN (R 4.3.0) viridis 0.6.2 2021-10-13 [1] CRAN (R 4.3.0) viridisLite 0.4.1 2022-08-22 [1] CRAN (R 4.3.0) waldo 0.4.0 2022-03-16 [1] CRAN (R 4.3.0) webshot 0.5.4 2022-09-26 [1] CRAN (R 4.3.0) whisker 0.4.1 2022-12-05 [1] CRAN (R 4.3.0) withr 2.5.0 2022-03-03 [1] CRAN (R 4.3.0) xfun 0.37 2023-01-31 [1] CRAN (R 4.3.0) XML 3.99-0.13 2022-12-04 [1] CRAN (R 4.3.0) xml2 1.3.3 2021-11-30 [2] CRAN (R 4.3.0) xopen 1.0.0 2018-09-17 [1] CRAN (R 4.3.0) xtable 1.8-4 2019-04-21 [2] CRAN (R 4.3.0) yaml 2.3.7 2023-01-23 [1] CRAN (R 4.3.0) yulab.utils 0.0.6 2022-12-20 [1] CRAN (R 4.3.0) zip 2.2.2 2022-10-26 [1] CRAN (R 4.3.0) [1] /__w/_temp/Library [2] /usr/local/lib/R/site-library [3] /usr/local/lib/R/library ```
bschilder commented 1 year ago

Oddly, I noticed the version on the Linux GHA is actually older than the one on my local machine. GHA might be using the cached installation with the bug in it, so will rerun with /nocache flag in commit message.

Version used on GHA Linux:

 ggnetwork        0.5.10    2021-07-06 [1] CRAN (R 4.3.0)

Version used on my local Mac:

 ggnetwork   * 0.5.12  2023-03-06 [1] CRAN (R 4.2.1)
bschilder commented 1 year ago

Oddly, I noticed the version on the Linux GHA is actually older than the one on my local machine. GHA might be using the cached installation with the bug in it, so will rerun with /nocache flag in commit message.

This did the trick! ThreeWayTestis now passing on all GHA runners.