Save a project to disk.
write_project(
x,
dataset,
path,
name,
spatial_path,
attribute_path,
boundary_path,
mode = "advanced",
user_groups = "public",
author_name = NULL,
author_email = NULL
)
x | |
---|---|
dataset | Dataset object. |
path |
|
name |
|
spatial_path |
|
attribute_path |
|
boundary_path |
|
mode |
|
user_groups |
|
author_name |
|
author_email |
|
Invisible TRUE
indicating success.
# 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 themes and weights
th <- simulate_themes(d, 1, 1, 2)
w <- simulate_weights(d, 1)
# combine themes and weights into a list
l <- append(th, w)
# save project
write_project(
x = l,
name = "example",
dataset = d,
path = tempfile(),
spatial_path = tempfile(fileext = ".tif"),
attribute_path = tempfile(fileext = ".csv.gz"),
boundary_path = tempfile(fileext = ".csv.gz")
)