schochastics / signnet

R package for signed networks
https://schochastics.github.io/signnet/
Other
22 stars 6 forks source link

Mismatch between package versions applied throughout the paper #16

Closed cosimameyer closed 1 year ago

cosimameyer commented 1 year ago

When reproducing the results presented in the paper, I experienced a small hic-up with the package versions. In the paper, you install the CRAN version (0.8.1) but use graph_from_adjacency_matrix_signed() in the "Centrality" section (which was, based on your release statements, introduced in 1.0.0 and currently the development version). To replicate the results, you'd need to also introduce the development package version call here.

When using version 1.0.0, however, I'm running into (exporting) errors and cannot reproduce the following code snippet from your paper:

g <- graph_from_adjacency_matrix_signed(A, "undirected")

It looks like the function was not correctly exported. I'm not 100% sure why this happens. You export the function graph_from_adjacency_matrix_signed () with @export and it's also listed in NAMESPACE - so everything looks good from this perspective. Within the signnet R-project package environment, it also works perfectly after loading the package. But when calling the function with signnet:: (or even signnet::: - just to eliminate all options) in another project, I get the following errors:

devtools::install_github("schochastics/signnet")
library(signnet)

g <- graph_from_adjacency_matrix_signed(A, "undirected")
# Error in graph_from_adjacency_matrix_signed(A, "undirected") : 
#  could not find function "graph_from_adjacency_matrix_signed"

g <- signnet::graph_from_adjacency_matrix_signed(A, "undirected")
# Error: 'graph_from_adjacency_matrix_signed' is not an exported object from 'namespace:signnet'

Calling ls("package:signnet") returns the following output where graph_from_adjacency_matrix_signed is not listed:

 [1] "as_adj_complex"            "as_adj_signed"             "as_complex_edges"         
 [4] "as_incidence_complex"      "as_incidence_signed"       "as_signed_proj"           
 [7] "as_unsigned_2mode"         "avatar"                    "balance_score"            
[10] "complex_walks"             "count_complex_triangles"   "count_signed_triangles"   
[13] "cowList"                   "degree_signed"             "eigen_centrality_signed"  
[16] "frustration_exact"         "ggblock"                   "ggsigned"                 
[19] "graph_circular_signed"     "laplacian_angle"           "laplacian_matrix_complex" 
[22] "laplacian_matrix_signed"   "pn_index"                  "sample_islands_signed"    
[25] "signed_blockmodel"         "signed_blockmodel_general" "signed_triangles"         
[28] "triad_census_signed"       "tribes"

Here is my session info:

─ Session info  setting  value
 version  R version 4.1.3 (2022-03-10)
 os       macOS 13.0.1
 system   x86_64, darwin17.0
 ui       RStudio
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       Europe/Berlin
 date     2022-12-21

(This issue is part of the review: https://github.com/openjournals/joss-reviews/issues/4987)

schochastics commented 1 year ago

@cosimameyer This error is really weird. I am not able to reproduce it. Can you double checkt that packageVersion("signnet") gives 1.0.0?

The version number confusion is my fault. I thought it would be better to release 1.0.0 only after the review process. In hindsight, it would have been smarter to send 1.0.0 to CRAN and after the review push a bugfix release. If the package is accepted, I will submit the update directly to CRAN so that there are no inconsitancies. I think that is a better solution than talking about the dev version in the paper.

cosimameyer commented 1 year ago

I cannot fully explain why but I've got good news: it works now with v1.0.0 and I can reproduce your paper πŸŽ‰
(to better understand what happened: I re-ran the short script that I used yesterday - in a new R project today; I didn't use packageVersion() but the RStudio GUI to check for the package version (probably that was the problem that it was a bit laggy in RStudio's interface and didn't display the correct version number))

In order to get the paper accepted, you would need to slightly change the order of your plans: First submit v1.0.0 to CRAN (because this is the basis of your paper and you give instructions for an installation as if the version was already on CRAN) and then get the paper accepted πŸ™‚

Otherwise you have a paper out there that cannot be replicated in its current version until CRAN approves the new version of your package.

schochastics commented 1 year ago

Yeah this makes far more sense than my original plans. I will submit it to CRAN today and let you know when it is accepted there

schochastics commented 1 year ago

@cosimameyer submitted and it was already accepted :open_mouth:

cosimameyer commented 1 year ago

That's fantastic news! (A bit like a Christmas miracle) πŸ₯³ I'll check the tests tomorrow and if they all pass, I'm very happy to close this issue ☺️

schochastics commented 1 year ago

Great thanks! :santa: