Skip to contents

Use model object in your package

Usage

rxUse(obj, overwrite = TRUE, compress = "bzip2", internal = FALSE)

Arguments

obj

model to save.

overwrite

By default, use_data() will not overwrite existing files. If you really want to do so, set this to TRUE.

compress

Choose the type of compression used by save(). Should be one of "gzip", "bzip2", or "xz".

internal

If this is run internally. By default this is FALSE

Value

Nothing; This is used for its side effects and shouldn't be called by a user

See also

Other Packaging: rxPkg()

Examples

# run from the root of a package source tree; writes into data/ and src/
if (interactive() && file.exists("DESCRIPTION")) {
  pk <- function() {
    model({
      d/dt(depot) <- -ka * depot
      d/dt(central) <- ka * depot - cl / v * central
    })
  }
  rxUse(pk)
  # regenerate the compiled code for every model in data/
  rxUse()
}