does `as.sna.edgelist = TRUE` argument to `as.edgelist` behave as intended?
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
Research direction
Start by running the supplied R example and inspect as.edgelist.matrix and as.matrix.network.edgelist, focusing on how as.sna.edgelist is handled. Done when as.edgelist(..., TRUE) produces the intended SNA edge representation while the FALSE behavior remains unchanged.
Written by the indexing model from the issue text.
Description
e.g.
require(network)
nw <- network.initialize(2, directed = FALSE)
nw[1,2] <- 1
as.matrix.network.edgelist(nw, as.sna.edgelist = FALSE)
as.matrix.network.edgelist(nw, as.sna.edgelist = TRUE)
as.edgelist(nw, as.sna.edgelist = FALSE)
as.edgelist(nw, as.sna.edgelist = TRUE)
produces
> as.matrix.network.edgelist(nw, as.sna.edgelist = FALSE)
[,1] [,2]
[1,] 1 2
attr(,"n")
[1] 2
attr(,"vnames")
[1] 1 2
> as.matrix.network.edgelist(nw, as.sna.edgelist = TRUE)
[,1] [,2] [,3]
[1,] 1 2 1
[2,] 2 1 1
attr(,"n")
[1] 2
attr(,"vnames")
[1] 1 2
> as.edgelist(nw, as.sna.edgelist = FALSE)
[,1] [,2]
[1,] 1 2
attr(,"n")
[1] 2
attr(,"vnames")
[1] 1 2
attr(,"directed")
[1] FALSE
attr(,"bipartite")
[1] FALSE
attr(,"loops")
[1] FALSE
attr(,"class")
[1] "matrix_edgelist" "edgelist" "matrix" "array"
> as.edgelist(nw, as.sna.edgelist = TRUE)
[,1] [,2] [,3]
[1,] 1 2 1
attr(,"n")
[1] 2
attr(,"vnames")
[1] 1 2
attr(,"directed")
[1] FALSE
attr(,"bipartite")
[1] FALSE
attr(,"loops")
[1] FALSE
attr(,"class")
[1] "matrix_edgelist" "edgelist" "matrix" "array"
i.e. the screening of edges in as.edgelist.matrix (which does not receive or recognize as.sna.edgelist in the current implementation) is dropping the "reversed" edge 2 1 from the output when as.sna.edgelist = TRUE is passed to as.edgelist, which seems like not what we want for sna (based on the behavior of as.matrix.network.edgelist).
- Dominant language
- R
- Stars
- 20
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from statnet/network
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Assigning a symmetric sociomatrix valued edges to an undriected network creates bidirectional edges. Openbug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Similar issues
-
Affects Web App documentation PRIORITY LOW
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
hubverse-org/hubCI#36 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
OHDSI/CohortSymmetry#351 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100