#| include: false
knitr::opts_chunk$set(fig.alt = " ")
knitr::opts_chunk$set(collapse = TRUE)

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)
set.seed(24601L)
result = tumopp::tumopp("-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 = tumopp::make_args(alt = .alt, const = .const, each = 1L) |> print()

# Concurrent execution
results = tumopp::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 April 12, 2025, 10:56 p.m.