Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an iteration error (issue #4) by replacing the apply(sapply()) pattern with sapply(lapply()) in two functions. The change corrects how minimum BIC and AICc values are extracted from a list of model fits. The PR also updates the test coverage workflow to use codecov-action v5, updates some package metadata, and regenerates README documentation with updated model output.
- Fixed iteration error in
get_oos_results()andfastTS()by changing fromapply(sapply(fits, BIC), 2, min)tosapply(lapply(fits, BIC), min) - Updated GitHub Actions workflow to use codecov-action v5 with explicit file upload
- Updated package maintainer email address and other metadata
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| R/helpers.R | Fixed iteration error in get_oos_results() function for BIC and AICc computation |
| R/fastTS.R | Fixed iteration error in main fastTS() function for BIC and AICc computation |
| README.md | Regenerated with updated model output and added duplicate Codecov badge |
| README.Rmd | Added duplicate Codecov test coverage badge |
| NEWS.md | Added entry documenting fix for issue #4 |
| DESCRIPTION | Updated maintainer email, RoxygenNote version, and package date |
| .github/workflows/test-coverage.yaml | Modernized workflow with codecov-action v5 and updated action versions |
Comments suppressed due to low confidence (3)
R/fastTS.R:218
- Incomplete fix: The same
apply(sapply())pattern that was fixed in lines 179 and 181 still exists here in theplot.fastTS()function. This should be changed tosapply(lapply(x$fits, AICc), min)for consistency and to prevent the same iteration error.
x$fits[[which.min(apply(sapply(x$fits, AICc), 2, min))]]
R/fastTS.R:249
- Incomplete fix: The same
apply(sapply())pattern that was fixed in lines 179 and 181 still exists here in thecoef.fastTS()function. This should be changed tosapply(lapply(object$fits, pen_fn), min)for consistency and to prevent the same iteration error.
object$fits[[which.min(apply(sapply(object$fits, pen_fn), 2, min))]]
R/fastTS.R:263
- Incomplete fix: The same
apply(sapply())pattern that was fixed in lines 179 and 181 still exists here in theprint.fastTS()function. These lines should be changed tosapply(lapply(x$fits, AICc), min)andsapply(lapply(x$fits, BIC), min)respectively for consistency and to prevent the same iteration error.
best_AICc = apply(sapply(x$fits, AICc), 2, min)
best_BIC = apply(sapply(x$fits, BIC), 2, min)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #4