Create a new Dataset object.
Usage
new_dataset(
  spatial_path,
  attribute_path,
  boundary_path,
  spatial_data = NULL,
  attribute_data = NULL,
  boundary_data = NULL,
  id = uuid::UUIDgenerate()
)Arguments
- spatial_path
- characterfile path for spatial data.
- attribute_path
- characterfile path for attribute data.
- boundary_path
- characterfile path for boundary data.
- spatial_data
- NULL,- sf::st_sf(), or- terra::rast()object. Defaults to- NULLsuch that data are automatically imported using the argument to- spatial_path.
- attribute_data
- NULL, or- tibble::tibble()object. Defaults to- NULLsuch that data are automatically imported using the argument to- attribute_path.
- boundary_data
- NULL, or- Matrix::sparseMatrix()object. Defaults to- NULLsuch that data are automatically imported using the argument to- boundary_path.
- id
- characterunique identifier. Defaults to a random identifier (- uuid::UUIDgenerate()).
Value
A Dataset object.
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)
# print object
print(d)
#> Dataset
#>   paths:
#>     spatial: C:/Users/Daniel Wismer/AppData/Local/Temp/RtmpsXqY7A/temp_libpath82d05f685712/wheretowork/extdata/projects/sim_raster/sim_raster_spatial.tif
#>     attribute: C:/Users/Daniel Wismer/AppData/Local/Temp/RtmpsXqY7A/temp_libpath82d05f685712/wheretowork/extdata/projects/sim_raster/sim_raster_attribute.csv.gz
#>     boundary: C:/Users/Daniel Wismer/AppData/Local/Temp/RtmpsXqY7A/temp_libpath82d05f685712/wheretowork/extdata/projects/sim_raster/sim_raster_boundary.csv.gz