View source: R/class_MapManager.R
new_map_manager | R Documentation |
Create a new MapManager object.
new_map_manager(layers, order = rev(seq_along(layers)))
layers |
|
order |
|
A MapManager object.
# create dataset
# 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)
# create variables
v1 <- new_variable_from_auto(dataset = d, index = 1)
v2 <- new_variable_from_auto(dataset = d, index = 2)
v3 <- new_variable_from_auto(dataset = d, index = 3)
v4 <- new_variable_from_auto(dataset = d, index = 4)
# create a weight using a variable
w <- new_weight(
name = "Human Footprint Index", variable = v1,
factor = -90, status = FALSE, id = "W1"
)
# create features using variables
f1 <- new_feature(
name = "Possum", variable = v2,
goal = 0.2, status = FALSE, current = 0.5, id = "F1"
)
f2 <- new_feature(
name = "Forests", variable = v3,
goal = 0.3, status = FALSE, current = 0.9, id = "F2"
)
f3 <- new_feature(
name = "Shrubs", variable = v4,
goal = 0.6, status = TRUE, current = 0.4, id = "F3"
)
# create themes using the features
t1 <- new_theme("Species", f1, id = "T1")
t2 <- new_theme("Ecoregions", list(f2, f3), id = "T2")
# create a map manager for the themes and weight
mm <- new_map_manager(layers = list(t1, t2, w))
# print object
print(mm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.