simulate_themes: Simulate themes

View source: R/fct_simulate_themes.R

simulate_themesR Documentation

Simulate themes

Description

This function simulates Theme objects.

Usage

simulate_themes(
  dataset,
  n_single_themes,
  n_multi_themes,
  lambda = 5,
  continuous = NA
)

Arguments

dataset

Dataset object.

n_single_themes

integer number of themes with a single feature to simulate.

n_multi_themes

integer number of themes with a multiple features to simulate.

lambda

numeric lambda parameter for simulating the number of features for themes that contain multiple features. This parameter is used as a argument to rpois(n, lambda = lambda). Defaults to 5.

continuous

logical should the data be continuous? Defaults to NA. If NA, simulated themes are a mix of continuous and categorical defined by a conditional: stats::runif(1) > 0.5

Value

A list of simulated Theme objects.

See Also

new_theme.

Examples

# find data file paths
f1 <- system.file(
  "extdata", "projects", "sim_raster", "sim_raster_spatial.tif",
  package = "wheretowork"
)
f2 <- system.file(
  "extdata",  "projects", "sim_raster", "sim_raster_attribute.csv.gz",
  package = "wheretowork"
)
f3 <- system.file(
  "extdata",  "projects", "sim_raster", "sim_raster_boundary.csv.gz",
  package = "wheretowork"
)

# create new dataset
d <- new_dataset(f1, f2, f3)

# simulate data
x <- simulate_themes(data = d, n_single_themes = 3, n_multi_themes = 2)
# print results
print(x)


NCC-CNC/wheretowork documentation built on Feb. 27, 2025, 6:11 p.m.