library(dplyr)
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Basic usage

This is an R interface of tumopp, a tumor growth simulator in C++. The parameter values and resulting populations are returned in a nested tibble. See ?tumopp for details.

library(tumopp)
result = tumopp("--seed=24601 -D3 -Cmoore -k10 -N1000")
colnames(result)
result$population[[1L]] |> dplyr::arrange(id)

Explore parameter space

A parameter grid can be generated with make_args(). See tumopp("--help") or C++ library documentation generated by doxygen for available parameters.

.const = list(D = 3L, C = "hex", N = 1000L)
.alt = list(
  k = c("1", "1e6"),
  L = c("const", "linear", "step"),
  P = c("random", "mindrag")
)

# Generate combinations of arguments
args_table = make_args(alt = .alt, const = .const, each = 1L) |> print()

# Concurrent execution
results = tumopp(args_table)
results |>
  dplyr::select(!c(outdir, seed, where(is.list))) |>
  dplyr::select(where(\(x) dplyr::n_distinct(x) > 1L))


heavywatal/rtumopp documentation built on March 30, 2024, 11:08 a.m.