Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ vignettes/precompile\.R
^Meta$
^CRAN-SUBMISSION$
^README\.Rmd$
^.mailmap$
^.mailmap$

Copilot AI Apr 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In .Rbuildignore entries are regexes; ^.mailmap$ treats . as “any character”, so it can match unintended filenames (e.g., xmailmap). Escape the dot to only ignore the .mailmap file (i.e., ^\.mailmap$).

Suggested change
^.mailmap$
^\.mailmap$

Copilot uses AI. Check for mistakes.
^\.positai$
^\.claude$
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ inst/tutorials/tutorial5/equivalence_data/*
toadd/*
.data.csv
cache/*
.positai
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: netrics
Title: Many Ways to Measure and Classify Membership for Networks, Nodes, and Ties
Version: 0.2.2
Date: 2026-04-24
Version: 0.2.3
Date: 2026-04-25
Description: Many tools for calculating network, node, or tie
marks, measures, motifs and memberships of many different types of networks.
Marks identify structural positions, measures quantify network properties,
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# netrics 0.2.3

## Tutorials

- Fixed object reference in position tutorial

# netrics 0.2.2

## Package
Expand Down
4 changes: 1 addition & 3 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,4 @@

0 errors | 0 warnings | 0 notes

- While last package submission was only 9 days ago:
- Updates to bring netrics into line with latest version of manynet (> v2.0.0)
- Fixes a reverse dependency issue in cross-package documentation referencing
- Fixed reverse dependency issue
10 changes: 6 additions & 4 deletions inst/tutorials/tutorial5/position.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ learnr::random_phrases_add(language = "en",
friends <- to_uniplex(ison_algebra, "friends")
social <- to_uniplex(ison_algebra, "social")
tasks <- to_uniplex(ison_algebra, "tasks")
alge <- to_named(ison_algebra)
```


Expand Down Expand Up @@ -479,7 +480,7 @@ What we are saying here is that we want to partition the nodes
into two clusters, no matter how dissimilar they are.

```{r k-discrete, exercise = TRUE, exercise.setup = "varyclust"}
plot(node_in_structural(alge, k = 2))
plot(node_in_structural(to_named(ison_algebra), k = 2))

Copilot AI Apr 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

varyclust (the exercise setup) already defines alge <- to_named(ison_algebra) for consistent fake node names across subsequent plots. Re-calling to_named(ison_algebra) here can generate a different naming each time (and undermines the comparison described above). Use the existing alge object from the setup instead of re-creating it.

Suggested change
plot(node_in_structural(to_named(ison_algebra), k = 2))
plot(node_in_structural(alge, k = 2))

Copilot uses AI. Check for mistakes.
```

But we're really just guessing. Maybe 2 is not the best `k`?
Expand Down Expand Up @@ -523,8 +524,8 @@ can return a somewhat different result to the elbow method.
See what we have here, with all other arguments held the same:

```{r elbowsil, exercise = TRUE, exercise.setup = "varyclust"}
plot(node_in_structural(alge, k = "elbow"))
plot(node_in_structural(alge, k = "silhouette"))
plot(node_in_structural(to_named(ison_algebra), k = "elbow"))
plot(node_in_structural(to_named(ison_algebra), k = "silhouette"))
Comment on lines +527 to +528

Copilot AI Apr 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as k-discrete: since exercise.setup = "varyclust" already created alge <- to_named(ison_algebra), calling to_named(ison_algebra) again here can yield different fake names between plots/runs. Reuse alge so the elbow vs silhouette outputs are directly comparable.

Suggested change
plot(node_in_structural(to_named(ison_algebra), k = "elbow"))
plot(node_in_structural(to_named(ison_algebra), k = "silhouette"))
plot(node_in_structural(alge, k = "elbow"))
plot(node_in_structural(alge, k = "silhouette"))

Copilot uses AI. Check for mistakes.
```

Ok, so it looks like the elbow method returns `k == 3` as a good trade-off
Expand All @@ -551,7 +552,7 @@ however oftentimes this misses the point in finding clusters of nodes that,
despite some variation, can be considered as similar on some dimension.

```{r strict, exercise = TRUE, exercise.setup = "varyclust"}
plot(node_in_structural(alge, k = "strict"))
plot(node_in_structural(to_named(ison_algebra), k = "strict"))

Copilot AI Apr 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exercise.setup = "varyclust" already defines alge <- to_named(ison_algebra) for consistent fake names. Calling to_named(ison_algebra) again here can change node labels between the dendrograms and this plot (and between runs). Use alge instead so the tutorial’s examples stay consistent.

Suggested change
plot(node_in_structural(to_named(ison_algebra), k = "strict"))
plot(node_in_structural(alge, k = "strict"))

Copilot uses AI. Check for mistakes.
```

Here for example, no two nodes have precisely the same tie-profile,
Expand All @@ -573,6 +574,7 @@ structurally equivalent classes.
We can graph this of course, as above:

```{r strplot, exercise = TRUE, exercise.setup = "varyclust"}
alge <- to_named(ison_algebra)

Copilot AI Apr 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alge is already available from exercise.setup = "varyclust". Re-creating it with to_named(ison_algebra) here can change the node labels relative to the dendrograms shown earlier, making the tutorial harder to follow. Prefer using the existing alge object.

Suggested change
alge <- to_named(ison_algebra)

Copilot uses AI. Check for mistakes.
alge %>%
mutate(se = node_in_structural(alge)) %>%
graphr(node_color = "se")
Expand Down
305 changes: 154 additions & 151 deletions inst/tutorials/tutorial5/position.html

Large diffs are not rendered by default.

Loading