Save a project to disk.
Usage
write_project(
x,
dataset,
path,
name,
spatial_path,
attribute_path,
boundary_path,
mode = "advanced",
user_groups = "public",
author_name = NULL,
author_email = NULL
)Arguments
- x
- dataset
Dataset object.
- path
characterfile path to save the configuration file.- name
charactername for the scenario.- spatial_path
characterfile path for the spatial data.- attribute_path
characterfile path for the attribute data.- boundary_path
characterfile path for the attribute data.- mode
charactermode for running the application. Defaults to"advanced".- user_groups
charactervector of user groups than can access the dataset. Defaults to"public".charactername of the project author. Defaults toNULLsuch that no author name is encoded in the project configuration file. This means that the application will report default contact details.characteremail address of the project author. Defaults toNULLsuch that no email address is encoded in the project configuration file. This means that the application will report default contact details.
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 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")
)