Create a new Theme object.
Usage
new_theme(
name,
feature,
feature_order = as.double(rev(seq_along(feature))),
id = uuid::UUIDgenerate()
)
Arguments
- name
character
Name to display.- feature
list
of Feature objects.- feature_order
numeric
Relative order for displaying each feature on a map. Defaults to a reverse sequence of integer values.- id
character
unique identifier. Defaults to a random identifier (uuid::UUIDgenerate()
).
Value
A Theme object.
Examples
# find data path
# 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 new variable
v <- new_variable_from_auto(d, index = 1)
# create new feature
f <- new_feature(name = "Intact Alvar map", variable = v)
# create a theme using the feature
x <- new_theme(name = "Intact Alvar", feature = f)
# print object
print(x)
#> Theme
#> id: 0f44b25b-61c4-4d37-a700-8689964ecf7b
#> name: Intact Alvar
#> feature:
#> Intact Alvar map [status: TRUE, current: 0, goal: 0.2]
#>
variable: .../sim_raster_spatial.tif#Brown_necked_Parrot_Brown_necked_ [total: 483 ]