Something odd (and subtle) is causing merge_simfiles
not to work.
I have generated 5 separate simfiles for a run on Hyak using standard methods. But now merge_simfiles
won't merge them, instead returning the error:
Error in merge.netsim(out, sim, param.error = FALSE, keep.other = FALSE) :
x and y have different structure
Burrowing down, it appears that the issue is because the checks on whether $params
is identical across the simfiles is failing. This is occurs in the line check1 <- identical(x$param, y$param)
in merge.netsim
. There are multiple elements that fail the check, but here is an example of one:
identical(x$param[1][[1]][[5]][[9]][[1]], y$param[1][[1]][[5]][[9]][[1]])
[1] FALSE
What is very strange is that each of the constituent components of these lists is identical:
length(x$param[1][[1]][[5]][[9]][[1]])
[1] 2
length(y$param[1][[1]][[5]][[9]][[1]])
[1] 2
identical(x$param[1][[1]][[5]][[9]][[1]][[1]], y$param[1][[1]][[5]][[9]][[1]][[1]])
[1] TRUE
identical(x$param[1][[1]][[5]][[9]][[1]][[2]], y$param[1][[1]][[5]][[9]][[1]][[2]])
[1] TRUE
At this point I am stymied. My hypothesis is that it has something to do with the environments being different between the two objects? But I really have no idea. Note that $param[1][[1]][[5]][[9]][[1]][[1]]
is not the only element that differs between x
and y
; it's just the first encountered.
What ends up happening is that, when the first two files fail the identical test, some of the elements get stripped out when they merge. And then when the time comes to merge that combo with sim file 3, they now don't have the same structure.
I am totally stymied. Help!
I can send you all the sim files to make a reproducible example, but they are large (over 1 GB each). I have .rda
listed in .gitignore
for that reason.
My session info is below. Thanks.
sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.3 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8
[4] LC_COLLATE=en_US.UTF-8 LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
time zone: America/Los_Angeles
tzcode source: system (glibc)
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] EpiModelHPC_2.2.0 EpiModel_2.4.0 statnet.common_4.9.0
[4] tergm_4.2.0 ergm_4.5.0 networkDynamic_0.11.3
[7] network_1.18.1 deSolve_1.36 MASS_7.3-60
loaded via a namespace (and not attached):
[1] gtable_0.3.3 networkLite_1.0.5 ggplot2_3.4.2
[4] ergm.multi_0.2.0 rle_0.9.2 lattice_0.21-8
[7] vctrs_0.6.3 tools_4.3.1 Rdpack_2.5
[10] generics_0.1.3 parallel_4.3.1 tibble_3.2.1
[13] fansi_1.0.4 DEoptimR_1.1-1 pkgconfig_2.0.3
[16] Matrix_1.6-0 egor_1.23.3 RColorBrewer_1.1-3
[19] lifecycle_1.0.3 stringr_1.5.0 compiler_4.3.1
[22] ergm.ego_1.1.0 munsell_0.5.0 mitools_2.4
[25] codetools_0.2-19 survey_4.2-1 lazyeval_0.2.2
[28] pillar_1.9.0 tidyr_1.3.0 cachem_1.0.8
[31] iterators_1.0.14 trust_0.1-8 foreach_1.5.2
[34] nlme_3.1-162 robustbase_0.99-0 tidyselect_1.2.0
[37] digest_0.6.33 stringi_1.7.12 dplyr_1.1.2
[40] purrr_1.0.1 splines_4.3.1 fastmap_1.1.1
[43] grid_4.3.1 colorspace_2.1-0 cli_3.6.1
[46] magrittr_2.0.3 tidygraph_1.2.3 survival_3.5-5
[49] utf8_1.2.3 ape_5.7-1 scales_1.2.1
[52] igraph_1.5.1 srvyr_1.2.0 coda_0.19-4
[55] memoise_2.0.1 lpSolveAPI_5.5.2.0-17.9 rbibutils_2.2.15
[58] doParallel_1.0.17 rlang_1.1.1 Rcpp_1.0.11
[61] glue_1.6.2 DBI_1.1.3 renv_0.15.4
[64] R6_2.5.1