Conversation
…, net_node_attributes(), and net_tie_attributes()
There was a problem hiding this comment.
Pull request overview
This PR appears to prepare the manynet R package for the v2.0.2 release by updating package metadata and refining stocnet documentation/creation behavior, while extending a few net_* measure methods to additional network classes.
Changes:
- Bump package version/date to 2.0.2 in
DESCRIPTION. - Update
make_stocnet()docs/examples and refactor construction/indexing logic for ties/changes. - Add/adjust S3 methods for network measures (
net_nodes,net_node_attributes,net_tie_attributes) and tweak tutorial chunkpurlbehavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| man/make_stocnet.Rd | Updates parameter docs and adds make_stocnet() examples. |
| inst/tutorials/tutorial1/data.Rmd | Sets some tutorial chunks to purl=FALSE and updates example dataset names/filenames. |
| R/measure_properties.R | Renames/introduces S3 methods for net_nodes() and adds network methods for attribute accessors. |
| R/class_validate.R | Renames internal validation helper functions for clarity (reserved_cols, required_cols, expect_class). |
| R/class_stocnet.R | Refactors make_stocnet() to coerce components and index ties/changes, plus updates roxygen docs/examples. |
| NAMESPACE | Registers new/changed S3 methods (notably net_nodes,tbl_igraph and network attribute methods). |
| DESCRIPTION | Bumps Version to 2.0.2 and updates Date. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| S3method(net_nodes,network) | ||
| S3method(net_nodes,stocnet) | ||
| S3method(net_nodes,tbl) | ||
| S3method(net_nodes,tbl_igraph) |
| nodes = dplyr::tibble(nodes), | ||
| ties = dplyr::tibble(ties), | ||
| changes = dplyr::tibble(changes) |
| .data$ties <- .data$ties |> | ||
| dplyr::mutate(from = as.numeric(match(from, nodes$label)), | ||
| to = as.numeric(match(to, nodes$label))) | ||
| } | ||
| .data | ||
| } | ||
|
|
||
| index_changes <- function(.data){ | ||
| if(is.character(.data$changes$node) && is.character(.data$nodes$label)){ | ||
| .data$changes <- .data$changes |> | ||
| dplyr::mutate(node = as.numeric(match(node, nodes$label))) |
| .data$ties <- .data$ties |> | ||
| dplyr::mutate(from = as.numeric(match(from, nodes$label)), | ||
| to = as.numeric(match(to, nodes$label))) | ||
| } | ||
| .data | ||
| } | ||
|
|
||
| index_changes <- function(.data){ | ||
| if(is.character(.data$changes$node) && is.character(.data$nodes$label)){ | ||
| .data$changes <- .data$changes |> | ||
| dplyr::mutate(node = as.numeric(match(node, nodes$label))) |
| @@ -58,6 +58,11 @@ net_nodes.tbl <- function(.data){ | |||
| call = deparse(sys.call())) | |||
| } | |||
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #134 +/- ##
==========================================
- Coverage 50.45% 50.44% -0.01%
==========================================
Files 34 34
Lines 3435 3477 +42
==========================================
+ Hits 1733 1754 +21
- Misses 1702 1723 +21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Checklist: