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(), orterra::rast()object. Defaults toNULLsuch that data are automatically imported using the argument tospatial_path.- attribute_data
NULL, ortibble::tibble()object. Defaults toNULLsuch that data are automatically imported using the argument toattribute_path.- boundary_data
NULL, orMatrix::sparseMatrix()object. Defaults toNULLsuch that data are automatically imported using the argument toboundary_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