Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

does `as.sna.edgelist = TRUE` argument to `as.edgelist` behave as intended?

Đang mở
#71 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
r
Lĩnh vực
data

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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).

Ngôn ngữ chính
R
Star
20
Fork
7
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của statnet/network

Tất cả issue của statnet/network

Issue tương tự

Thêm issue về R

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.