-
Notifications
You must be signed in to change notification settings - Fork 8
v1.5.7 #311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v1.5.7 #311
Changes from all commits
caa307c
72b2dd8
2071a67
4ed14e1
1409977
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -97,6 +97,17 @@ tidy.ergm <- function( | |||||||||||||||||||||||||||||||||||||
| dplyr::as_tibble(ret) | ||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| #' @method tidy sienaFit | ||||||||||||||||||||||||||||||||||||||
| #' @export | ||||||||||||||||||||||||||||||||||||||
| tidy.sienaFit <- function(ans){ | ||||||||||||||||||||||||||||||||||||||
| tibble::tibble( | ||||||||||||||||||||||||||||||||||||||
| dv = ans$effects$name, | ||||||||||||||||||||||||||||||||||||||
| term = ans$effects$effectName, | ||||||||||||||||||||||||||||||||||||||
| estimate = ans$theta, | ||||||||||||||||||||||||||||||||||||||
| se = ans$se, | ||||||||||||||||||||||||||||||||||||||
| tstat = ans$theta/ans$se | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+107
to
+108
|
||||||||||||||||||||||||||||||||||||||
| se = ans$se, | |
| tstat = ans$theta/ans$se | |
| std.error = ans$se, | |
| statistic = ans$theta/ans$se |
Copilot
AI
Feb 18, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tidy.sienaFit() does not accept ..., so generics::tidy() calls that pass additional arguments will error with “unused argument”. To stay compatible with the generics/broom style used elsewhere in this file (e.g., tidy.netlm, tidy.ergm), add a ... parameter (and preferably name the first argument x).
| tidy.sienaFit <- function(ans){ | |
| tibble::tibble( | |
| dv = ans$effects$name, | |
| term = ans$effects$effectName, | |
| estimate = ans$theta, | |
| se = ans$se, | |
| tstat = ans$theta/ans$se | |
| tidy.sienaFit <- function(x, ...) { | |
| tibble::tibble( | |
| dv = x$effects$name, | |
| term = x$effects$effectName, | |
| estimate = x$theta, | |
| se = x$se, | |
| tstat = x$theta / x$se |
Copilot
AI
Feb 18, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New S3 methods are added for tidy.sienaFit, glance.sienaFit, and summary.sienaFit, but there are no tests asserting dispatch and basic output shape/column names (contrast with tests/testthat/test-model_regression.R which tests tidy()/glance() for netlm/netlogit). Adding a small test fixture (or mocking a minimal sienaFit-like object if feasible) would help prevent regressions.
Copilot
AI
Feb 18, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
glance.sienaFit() does not accept ..., so generics::glance() calls that pass additional arguments will error with “unused argument”. For compatibility with the generic (and with the other glance.* methods in this file), add a ... parameter (and preferably name the first argument x).
| glance.sienaFit <- function(ans){ | |
| tibble::tibble( | |
| tmax = ans$tmax, | |
| tconv.max = ans$tconv.max[,1] | |
| glance.sienaFit <- function(x, ...) { | |
| tibble::tibble( | |
| tmax = x$tmax, | |
| tconv.max = x$tconv.max[, 1] |
Copilot
AI
Feb 18, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Defining a new summary.ergm() here will mask ergm’s own summary.ergm() method when migraph is loaded, and it also creates an infinite recursion: summary.ergm() calls tidy(x), but tidy.ergm() calls summary(x, ...), which will dispatch back to this summary.ergm(). This will break tidy.ergm(), glance.ergm(), and summary() for ergm fits. Consider restoring print.ergm() (as before) and not registering summary.ergm(), or implement a non-conflicting helper (or a method for a migraph-specific subclass) that does not override ergm’s summary method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing
S3method(print,ergm)and registeringS3method(summary,ergm)is a behavioral breaking change forergmobjects and will also overrideergm’s ownsummary.ergm()method. Given the recursion issue withtidy.ergm()/glance.ergm(), it’s safer to keep the custom printer asprint.ergm()(if desired) and avoid registeringsummary.ergm()for theergmclass.