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: d566f150-be2b-4527-8aea-b2c95a7019c8
#> name: Transportation network
#> variable: .../sim_raster_spatial.tif#Transportation_network [total: 151.94 ha]
#> pane: 9b98661d-697a-4eeb-abcf-1d1ea0e4c4bb-Transportation_network
#> current: 0.55
#> visible: TRUE
#> invisible: NA
#> loaded: TRUE
#> hidden: FALSE
#> downloadable: TRUE
#> status: TRUE
#> factor: 0
#>
#> [[2]]
#> Weight
#> id: ff12373f-36ce-4e6a-987c-7e720229b029
#> name: Habitat intactness index
#> variable: .../sim_raster_spatial.tif#Habitat_intactness_index [total: 106.76 ha]
#> pane: 265c9a3d-6962-4d00-b7b0-7b5be79eb72c-Habitat_intactness_index
#> current: 0.34
#> visible: TRUE
#> invisible: NA
#> loaded: TRUE
#> hidden: FALSE
#> downloadable: TRUE
#> status: TRUE
#> factor: 0
#>