Fix invalid formula error in round_to_seq example and bump version to 1.24.1#72
Fix invalid formula error in round_to_seq example and bump version to 1.24.1#72
Conversation
Co-authored-by: gvegayon <893619+gvegayon@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes a CRAN example failure in round_to_seq() triggered by a change in R 4.4.0’s internal formula handling when plot.data.frame() is called with a second positional argument.
Changes:
- Updates the
round_to_seqroxygen example fromplot(w, x)toplot(w)to avoid the invalid-formula path inplot.data.frame(). - Regenerates/syncs the corresponding
.Rddocumentation to match the updated example.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
R/plot_diffnet2.r |
Updates the round_to_seq example to call plot() with only the data.frame argument. |
man/round_to_seq.Rd |
Syncs the generated documentation example with the roxygen source change. |
|
@aoliveram, what were you trying to do in the example that was fixed by copilot? Is the fix correct? |
|
Hi @gvegayon. I don't remember having worked on that particular example, or anything related to |
There was a problem hiding this comment.
I ran the example using
> packageVersion("netdiffuseR")
[1] ‘1.24.0’
and effectively the plots are equal, except for the xlab:
library(netdiffuseR)
x <- rnorm(100)
w <- data.frame(as.integer(round_to_seq(x, as_factor = TRUE)),x)
plot(w,x) # --> weird xlab (numerical)
plot(w) # --> also weird xlab (non-numerical)
There was a problem hiding this comment.
Makes sense. Thanks for checking. I just asked copilot to make a few changes before we resubmit to CRAN.
aoliveram
left a comment
There was a problem hiding this comment.
All the checks have passed (at least the ones from github), so there shouldn't be a problem.
gvegayon
left a comment
There was a problem hiding this comment.
@copilot, ensure you:
- Bump the version to version 1.24.1
- Update the NEWS.md file to include this change.
- Re-run
devtools::document()to ensure all documentation is up to date. - Ensure you re-generate the README.md file so it reflects the new version of the package.
Co-authored-by: gvegayon <893619+gvegayon@users.noreply.github.com>
Done in commit
For |
R 4.4.0's
formula.defaultinternally uses%||%, which triggers an "invalid formula" error whenplot.data.frameis called with a second positional argument. Theround_to_seqexample hit this viaplot(w, x)wherewis a data.frame andxa numeric vector.Changes
R/plot_diffnet2.r— Fix example:plot(w, x)→plot(w)man/round_to_seq.Rd— Sync generated docs with the same fixDESCRIPTION— Version bumped from 1.24.0 to 1.24.1NEWS.md— Added entry for version 1.24.1 documenting the fixREADME.md— Updated hardcoded version references (citation block andsessionInfo()output) to 1.24.1walready contains both columns, so the second argument was both incorrect and unnecessary.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.