simulate_weights: Simulate weights

View source: R/fct_simulate_weights.R

simulate_weightsR Documentation

Simulate weights

Description

This function simulates Weight objects.

Usage

simulate_weights(dataset, n, continuous = TRUE)

Arguments

dataset

Dataset object.

n

integer number of weights to simulate.

continuous

logical should the data be continuous? Defaults to TRUE.

Value

A list of simulated Weight objects.

See Also

new_weight.

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_weights(dataset = d, n = 2)
# print results
print(x)



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