Conversation
There was a problem hiding this comment.
Pull request overview
This PR bumps the package to v0.2.3 and updates Tutorial 5 (“Position and Equivalence”) to address an object reference issue in the structural equivalence section.
Changes:
- Bumped
DESCRIPTIONversion/date and added aNEWS.mdentry for 0.2.3. - Updated Tutorial 5 source (
position.Rmd) and rendered output (position.html) with revised object usage (to_named(ison_algebra)/alge). - Ignored new local/tooling files via
.gitignore/.Rbuildignore.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| inst/tutorials/tutorial5/position.Rmd | Updates tutorial setup and exercise chunks around to_named() / alge usage. |
| inst/tutorials/tutorial5/position.html | Re-rendered tutorial output reflecting the updated Rmd code and learnr metadata. |
| NEWS.md | Adds release notes for 0.2.3 (tutorial fix). |
| DESCRIPTION | Bumps package version to 0.2.3 and updates the Date field. |
| .gitignore | Ignores .positai. |
| .Rbuildignore | Ensures .positai / .claude aren’t included in builds; adjusts .mailmap entry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| ```{r strict, exercise = TRUE, exercise.setup = "varyclust"} | ||
| plot(node_in_structural(alge, k = "strict")) | ||
| plot(node_in_structural(to_named(ison_algebra), k = "strict")) |
There was a problem hiding this comment.
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.
| plot(node_in_structural(to_named(ison_algebra), k = "strict")) | |
| plot(node_in_structural(alge, k = "strict")) |
| data-completion="1" data-diagnostics="1" data-startover="1" | ||
| data-lines="0" data-pipe="|>"> | ||
| <pre class="text"><code>plot(node_in_structural(alge, k = 2))</code></pre> | ||
| <pre class="text"><code>plot(node_in_structural(to_named(ison_algebra), k = 2))</code></pre> |
There was a problem hiding this comment.
This snippet switched from using the previously defined alge to calling to_named(ison_algebra) inline. Since to_named() can generate different fake names each call, this can make node labels inconsistent across the tutorial. Prefer plot(node_in_structural(alge, ...)) with alge set once in setup.
| ^CRAN-SUBMISSION$ | ||
| ^README\.Rmd$ | ||
| ^.mailmap$ No newline at end of file | ||
| ^.mailmap$ |
There was a problem hiding this comment.
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$).
| ^.mailmap$ | |
| ^\.mailmap$ |
| We can graph this of course, as above: | ||
|
|
||
| ```{r strplot, exercise = TRUE, exercise.setup = "varyclust"} | ||
| alge <- to_named(ison_algebra) |
There was a problem hiding this comment.
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.
| alge <- to_named(ison_algebra) |
| <pre class="text"><code>plot(node_in_structural(to_named(ison_algebra), k = "elbow")) | ||
| plot(node_in_structural(to_named(ison_algebra), k = "silhouette"))</code></pre> |
There was a problem hiding this comment.
These examples now call to_named(ison_algebra) for each plot. Because to_named() may generate different fake names on each call, the elbow vs silhouette plots may not be directly comparable in the rendered tutorial. Reuse a single alge <- to_named(ison_algebra) defined once in setup and pass alge into node_in_structural().
| data-diagnostics="1" data-startover="1" data-lines="0" | ||
| data-pipe="|>"> | ||
| <pre class="text"><code>plot(node_in_structural(alge, k = "strict"))</code></pre> | ||
| <pre class="text"><code>plot(node_in_structural(to_named(ison_algebra), k = "strict"))</code></pre> |
There was a problem hiding this comment.
Same as the earlier chunks: this calls to_named(ison_algebra) inline, which can lead to inconsistent node labels across tutorial steps. Prefer using a single alge object created once in the tutorial setup and then calling node_in_structural(alge, k = "strict").
| <pre class="text"><code>alge <- to_named(ison_algebra) | ||
| alge %>% |
There was a problem hiding this comment.
This chunk reassigns alge <- to_named(ison_algebra) locally even though the tutorial setup already creates alge. Re-running to_named() here can change fake names mid-tutorial, making it harder to relate this plot back to earlier dendrograms. Reuse the existing alge from setup instead of re-creating it.
|
|
||
| ```{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)) |
There was a problem hiding this comment.
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.
| plot(node_in_structural(to_named(ison_algebra), k = 2)) | |
| plot(node_in_structural(alge, k = 2)) |
| plot(node_in_structural(to_named(ison_algebra), k = "elbow")) | ||
| plot(node_in_structural(to_named(ison_algebra), k = "silhouette")) |
There was a problem hiding this comment.
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.
| 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")) |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #11 +/- ##
=======================================
Coverage 81.95% 81.95%
=======================================
Files 24 24
Lines 2394 2394
=======================================
Hits 1962 1962
Misses 432 432 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Checklist: