Implement remaining network methods for networkLite#14
Draft
Conversation
Co-authored-by: krivit <15682462+krivit@users.noreply.github.com>
Co-authored-by: krivit <15682462+krivit@users.noreply.github.com>
….density Co-authored-by: krivit <15682462+krivit@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement remaining network methods for networkLite
Implement remaining network methods for networkLite
Feb 9, 2026
Collaborator
|
@copilot Refer to statnet/network@master for the current methods for network, which have been turned into generics. |
Co-authored-by: krivit <15682462+krivit@users.noreply.github.com>
Author
Updated to use the generics from network package master branch. Removed the wrapper generic definitions and default methods, keeping only the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
networkLite lacked implementations for 8 network package methods. Two already worked (
get.inducedSubgraph,network.density); six required implementation.Implementation Strategy
The network package (version >= 1.19.0) provides S3 generics for these methods. This PR implements the
.networkLiteS3 methods that dispatch through the network package's native generics:Methods Implemented
Edge queries:
get.edgeIDs.networkLite(x, v, alter, neighborhood, na.omit)- single dyad or incident edgesget.dyads.eids.networkLite(x, tails, heads, ...)- vectorized multi-dyad queriesget.edges.networkLite(x, v, alter, neighborhood, na.omit)- incident edge IDsTopology queries:
is.adjacent.networkLite(x, vi, vj, na.omit)- edge existence test (defaultna.omit=FALSEmatches network package)get.neighborhood.networkLite(x, v, type, na.omit)- adjacent verticeshas.edges.networkLite(net, v)- any incident edges on verticesExample Usage
All methods support directed/undirected/bipartite networks and properly handle the
naedge attribute.Compatibility
Requires network package >= 1.19.0 (currently on master branch) which provides the S3 generics for proper method dispatch.
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.