R/get_ode_model_size.R

Defines functions get_ode_model_size

Documented in get_ode_model_size

#' Get the number of states in the ODE from the code
#' code C++ code for model
#' @param code C++ code
#' @export
#' @return Number of states in the ODE model
get_ode_model_size <- function(code) {
  m <- gregexpr("\\[([0-9]*)\\]", code)
  m1 <- unlist(regmatches(code, m))
  tmp <- 0
  return(length(unique(m1)))
}

Try the PKPDsim package in your browser

Any scripts or data that you put into this service are public.

PKPDsim documentation built on March 7, 2023, 5:40 p.m.