View source: R/class_Variable.R
new_variable | R Documentation |
Create a new Variable object.
new_variable(
dataset,
index,
units,
total,
legend,
provenance = new_provenance_from_source("missing")
)
dataset |
|
index |
|
units |
|
total |
|
legend |
|
provenance |
Provenance object.
Defaults to |
A Variable object.
# 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(d,
index = 1, total = 12, units = "ha",
legend = new_continuous_legend(1, 100, c("#000000", "#AAAAAA"))
)
# print object
print(v)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.