-
Notifications
You must be signed in to change notification settings - Fork 15
RXR-2394: lagtime updates #122
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
Changes from all commits
c4b21ba
fde2c24
672f561
128be21
d919a6b
218784d
09ec2b6
7c8c95b
c420315
5899fa6
90e003b
4a7468c
c967795
62bcd77
e7579fa
1fc7744
dafa5c3
e79239b
513ab13
a8654b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| #' Parse lagtime specified to main sim() function | ||
| #' | ||
| #' @inheritParams sim | ||
| #' | ||
| #' @returns a vector of character or numeric values | ||
| #' | ||
| parse_lagtime <- function( | ||
| lagtime, | ||
| ode, | ||
| parameters | ||
| ) { | ||
| lagtime_ode <- attr(ode, "lagtime") | ||
| # override from ode if not specified by user and defined in ode | ||
| if(is.null(lagtime) && !is.null(lagtime_ode) && lagtime_ode[1] != "NULL" && lagtime_ode[1] != "undefined") { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this be a |
||
| lagtime <- lagtime_ode | ||
| } | ||
| if(is.null(lagtime)) { | ||
| lagtime <- 0 | ||
| } | ||
| if(inherits(lagtime, "character")) { | ||
| idx <- grep("[a-zA-Z]", lagtime) # only pick character names, not "0" | ||
| if(! all(lagtime[idx] %in% names(parameters))) { | ||
| warning("Lagtime parameter(s) not found. Please check model and parameters.") | ||
| } | ||
| } | ||
| lagtime | ||
| } | ||
This file was deleted.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.