This function simulates Weight objects.
Arguments
- dataset
Dataset object.
- n
integernumber of weights to simulate.- continuous
logicalshould the data be continuous? Defaults toTRUE.
Value
A list of simulated Weight objects.
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)
#> [[1]]
#> Weight
#> id: a228da49-f59e-434b-a4fc-ad34cc371b56
#> name: Transportation network
#> variable: .../sim_raster_spatial.tif#Transportation_network [total: 151.94 ha]
#> pane: 079942f8-99bc-4442-aa13-e9c734ea32ed-Transportation_network
#> current: 0.55
#> visible: TRUE
#> invisible: NA
#> loaded: TRUE
#> hidden: FALSE
#> downloadable: TRUE
#> status: TRUE
#> factor: 0
#>
#> [[2]]
#> Weight
#> id: 7718fa68-02d0-4f42-a859-8c9b17913dc4
#> name: Habitat intactness index
#> variable: .../sim_raster_spatial.tif#Habitat_intactness_index [total: 106.76 ha]
#> pane: d311d022-6964-430a-8613-129352ea802d-Habitat_intactness_index
#> current: 0.34
#> visible: TRUE
#> invisible: NA
#> loaded: TRUE
#> hidden: FALSE
#> downloadable: TRUE
#> status: TRUE
#> factor: 0
#>