Introduce MizerRate S3 class for rate function outputs#332
Merged
gustavdelius merged 9 commits intomasterfrom Apr 9, 2026
Merged
Introduce MizerRate S3 class for rate function outputs#332gustavdelius merged 9 commits intomasterfrom
gustavdelius merged 9 commits intomasterfrom
Conversation
… with improved printing, summary, and plotting capabilities.
… the constructor.
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.
Summary
MizerRateS3 class, a lightweight wrapper around species × size matrices returned by rate functions (getEncounter(),getFeedingLevel(),getMort(),getEGrowth(),getFMort(), etc.). It carriesrate_nameandunitsattributes and provides enhancedprint(),summary(),plot(), andas.data.frame()methods while behaving transparently as a plain matrix for arithmetic and subsetting.MizerRateobjects inside the constructor.@returntags forget*rate functions inR/rate_functions.Rto reflect that they now return aMizerRateobject.MizerRateandis.MizerRateto the Classes section of the pkgdown reference index.## The MizerRate classsection tovignettes/developer_vignette.Rmd.## Plotting rate functionssection tovignettes/plotting.Rmddemonstratingplot()andas.data.frame()onMizerRateobjects.tests/testthat/test-project_methods.Rcaused by MizerRate attribute propagation.Test plan
devtools::test()passes with no failuresdevtools::check()passes with no errors or warningsdevtools::document()regenerates man pages cleanlyplot(getEncounter(NS_params), NS_params)produces a correctly coloured line plotsummary(getFeedingLevel(NS_params))prints a per-species table🤖 Generated with Claude Code