diff --git a/DESCRIPTION b/DESCRIPTION index afc978286..edb5e34bb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -18,7 +18,7 @@ Authors@R: c(person("Gustav", "Delius", email="gustav.delius@york.ac.uk", comment = c(ORCID = "0000-0002-8478-3430")), person("Richard", "Southwell", email="richard.southwell@york.ac.uk", role=c("ctb", "cph"))) -Version: 2.0.1.9002 +Version: 2.0.2 License: GPL-3 Imports: assertthat, diff --git a/NAMESPACE b/NAMESPACE index 85b3db6ef..9b4467078 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -134,9 +134,11 @@ export(project) export(project_simple) export(removeComponent) export(resource_constant) +export(resource_encounter) export(resource_params) export(resource_semichemostat) export(retune_erepro) +export(semichemostat) export(setColours) export(setComponent) export(setExtMort) @@ -161,6 +163,7 @@ export(sigmoid_length) export(sigmoid_weight) export(species_params) export(steady) +export(test_dyn) export(truncated_lognormal_pred_kernel) export(upgradeParams) export(upgradeSim) diff --git a/NEWS.md b/NEWS.md index 4b4d869df..ec084c411 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,15 +1,15 @@ -# mizer 2.0.1.9002 +# mizer 2.0.2 ## Bug fixes -* Time passed to rate functions is now the actual time, not the time elapsed - since start of simulation. +* Time passed to rate functions is now the actual simulation time, not the time + elapsed since start of simulation. * `upgradeParams()` works also on params objects that were created with a development version of mizer. * When upgrading an older params object, `upgradeParams()` does a better job at guessing the value for `w_pp_cutoff`. * `getFeedingLevel()`, `getPredMort()`, `setInitialValues()` and `steady()` now - works also when model has extra components. + work also when model has extra components. * The critical feeding level lines are now mentioned in the legend of `plotFeedinglevel()` when called with `include_critical = TRUE`, see #162. * Avoid annoying warnings from dplyr package when `species_params` is a tibble. @@ -36,7 +36,8 @@ time steps. This might be useful to extension writers. * The `...` argument to `project()` is passed on to the dynamics and rate functions. -* `steady()` runs faster using `project_simple()`. +* `steady()` runs faster by using `project_simple()`. +* Documentation on mizer website now has a search bar. # mizer 2.0.1 @@ -57,7 +58,7 @@ renaming * `r_resource` -> `resource_rate` * `K_resource` -> `resource_capacity` -## New functionality +## Minor enhancements * New functions `other_params()<-` and `other_params()` for setting and getting other parameters, for example to be used in user-defined rate diff --git a/R/extension.R b/R/extension.R index 5bf4badd0..8143be441 100644 --- a/R/extension.R +++ b/R/extension.R @@ -274,13 +274,20 @@ finalNOther <- function(sim) { n_other } -#' Dummy functions used during testing only +#' Dummy function used during testing only #' #' @param params A MizerParams object #' @param ... Other parameters +#' @export test_dyn <- function(params, ...) { 111 } +#' Dummy function used during testing only +#' +#' @inheritParams resource_constant +#' @inheritParams constant_other +#' @param ... Unused +#' @export semichemostat <- function(params, n_other, rates, dt, component, ...) { c <- params@other_params[[component]] interaction <- params@species_params$interaction_resource @@ -288,6 +295,10 @@ semichemostat <- function(params, n_other, rates, dt, component, ...) { tmp <- c$rate * c$capacity / (c$rate + mort) return(tmp - (tmp - n_other[[component]]) * exp(-(c$rate + mort) * dt)) } +#' Dummy function used during testing only +#' +#' @inheritParams resource_constant +#' @export resource_encounter <- function(params, n, n_pp, n_other, ...) { mizerEncounter(params, n = n, n_pp = n_other$resource, ...) } \ No newline at end of file diff --git a/R/steady.R b/R/steady.R index 06d08b81a..e4668afac 100644 --- a/R/steady.R +++ b/R/steady.R @@ -188,6 +188,11 @@ retune_erepro <- function(params, species = species_params(params)$species) { #' Helper function to keep other components constant +#' +#' @param params MizerParams object +#' @param n_other Abundances of other components +#' @param component Name of the component that is being updated +#' @param ... Unused #' @export constant_other <- function(params, n_other, component, ...) { n_other[[component]] diff --git a/R/summary_methods.R b/R/summary_methods.R index 77cd47d33..1228e5804 100644 --- a/R/summary_methods.R +++ b/R/summary_methods.R @@ -46,7 +46,7 @@ NULL #' available biomass. Outside the range of sizes for a predator species the #' returned rate is zero. #' -#' @param params A MizerParams object +#' @inheritParams getEncounter #' @param proportion If TRUE (default) the function returns the diet as a #' proportion of the total consumption rate. If FALSE it returns the #' consumption rate in grams. diff --git a/cran-comments.md b/cran-comments.md index 88a0f73e6..eb3e2e059 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -4,5 +4,5 @@ 0 errors ✓ | 0 warnings ✓ | 0 notes ✓ -* win-builder (devel, release and oldrelease) +* win-builder (release and oldrelease) No Notes, Warnings or Errors diff --git a/inst/WORDLIST b/inst/WORDLIST index 73fe75523..8e6c7a0a4 100644 --- a/inst/WORDLIST +++ b/inst/WORDLIST @@ -1,92 +1,85 @@ Acad Algolia allometrically +backreaction Bertalanffy Beverton Beyer bycatch camelCase +Canales catchabilities catchability Catchability cdot -Cefas -chemostatic cjfas Collingridge +color +colors com Conseil cran csv cutoff cutoffs -cW Datta Deepfishman Deepwater DEFINEIT Defra demersal -detritivores -detritivorous devtools +dialog discretisation discretises -DK -DP Docsearch doi +DP +dplyr dropdown dt -DTU du dw EBFM eq -Eq -erepro +eqn etc eu faf -feces fft Foerster frac -func +getEncounter getERepro -getFeedingLevel getGrowthCurves -getM getMort -getResourceMort getPredMort +getResourceMort +gganimate ggplot github Github GitHubPages +harddrive Hinzen Holling -ht iframe ij inf Inf infty int -io -ip -IPSC +iR ji jp -knitr ks Lenfest LFI -linecolour linetype linetypes -macroflora +Mariella Marifish +McKendrick McKendrik md MERP @@ -95,12 +88,10 @@ MESOPP metab minouw MINOUW -mizer's mizerExamples mizerExperimental MizerParams MizerSim -modeled modeling mort MSY @@ -108,15 +99,10 @@ muf mup mupp MvF -MVF navbar -nb -ncolumns -nrows Oceanologica offs org -packageDescription parameterisations parameterise params @@ -124,17 +110,15 @@ Pedersen Piet pkgdown PLoS -plotBiomass plotFeedingLevel -plotFMort plotGrowthCurves plotly -Plotly plotPredMort ppmr pred Proc proj +propto R's R’s rdd @@ -144,54 +128,46 @@ Rdoc reexports Ren repro -res Ricker rmarkdown Rmarkdown -Rmax +RMarkdown Rmd roxygen -Roxygen -roxygenize Rp +Rstudio RStudio +RStudio's Sandeel Sci sel selectivities semichemostat -setparams +setParams Sheperd shinytest sigmoidal -sim Sinica sIZE +sizer sizespectrum sp spawners -srr -SRR -SRRs SSB stackoverflow -std subfunctions Szuwalski testthat -th +tibble tidyverse -tol trophic Trophic tt u unfished -Ursin vb vdiffr vol -WMAT www Xue zooplanktivorous diff --git a/man/constant_other.Rd b/man/constant_other.Rd index 3b992c107..a921d1b83 100644 --- a/man/constant_other.Rd +++ b/man/constant_other.Rd @@ -6,6 +6,15 @@ \usage{ constant_other(params, n_other, component, ...) } +\arguments{ +\item{params}{MizerParams object} + +\item{n_other}{Abundances of other components} + +\item{component}{Name of the component that is being updated} + +\item{...}{Unused} +} \description{ Helper function to keep other components constant } diff --git a/man/getDiet.Rd b/man/getDiet.Rd index 36f6058ef..05b4a7f06 100644 --- a/man/getDiet.Rd +++ b/man/getDiet.Rd @@ -13,7 +13,14 @@ getDiet( ) } \arguments{ -\item{params}{A MizerParams object} +\item{params}{A \linkS4class{MizerParams} object} + +\item{n}{A matrix of species abundances (species x size).} + +\item{n_pp}{A vector of the resource abundance by size} + +\item{n_other}{A list of abundances for other dynamical components of the +ecosystem} \item{proportion}{If TRUE (default) the function returns the diet as a proportion of the total consumption rate. If FALSE it returns the diff --git a/man/resource_encounter.Rd b/man/resource_encounter.Rd new file mode 100644 index 000000000..6de16d3aa --- /dev/null +++ b/man/resource_encounter.Rd @@ -0,0 +1,22 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/extension.R +\name{resource_encounter} +\alias{resource_encounter} +\title{Dummy function used during testing only} +\usage{ +resource_encounter(params, n, n_pp, n_other, ...) +} +\arguments{ +\item{params}{A \link{MizerParams} object} + +\item{n}{A matrix of species abundances (species x size)} + +\item{n_pp}{A vector of the resource abundance by size} + +\item{n_other}{A list with the abundances of other components} + +\item{...}{Unused} +} +\description{ +Dummy function used during testing only +} diff --git a/man/semichemostat.Rd b/man/semichemostat.Rd new file mode 100644 index 000000000..d039a15f0 --- /dev/null +++ b/man/semichemostat.Rd @@ -0,0 +1,24 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/extension.R +\name{semichemostat} +\alias{semichemostat} +\title{Dummy function used during testing only} +\usage{ +semichemostat(params, n_other, rates, dt, component, ...) +} +\arguments{ +\item{params}{A \link{MizerParams} object} + +\item{n_other}{A list with the abundances of other components} + +\item{rates}{A list of rates as returned by \code{\link[=mizerRates]{mizerRates()}}} + +\item{dt}{Time step} + +\item{component}{Name of the component that is being updated} + +\item{...}{Unused} +} +\description{ +Dummy function used during testing only +} diff --git a/man/test_dyn.Rd b/man/test_dyn.Rd index dce820acc..91a971fb1 100644 --- a/man/test_dyn.Rd +++ b/man/test_dyn.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/extension.R \name{test_dyn} \alias{test_dyn} -\title{Dummy functions used during testing only} +\title{Dummy function used during testing only} \usage{ test_dyn(params, ...) } @@ -12,5 +12,5 @@ test_dyn(params, ...) \item{...}{Other parameters} } \description{ -Dummy functions used during testing only +Dummy function used during testing only }