Create a new Solution object.
Usage
new_solution(
  name,
  variable,
  visible,
  invisible = NA_real_,
  loaded = TRUE,
  parameters,
  statistics,
  theme_results,
  weight_results,
  include_results,
  exclude_results,
  id = uuid::UUIDgenerate(),
  hidden = FALSE,
  downloadable = TRUE,
  pane = paste(uuid::UUIDgenerate(), variable$index, sep = "-")
)Arguments
- name
- charactername for new solution.
- variable
- Variable object with the solution. 
- visible
- logicalshould the solution be visible on a map?
- invisible
- numericdate/time. A time stamp date given to when a loaded layer is first turned invisible. This is used to keep track of loaded invisible layers to offload once the cache threshold has been reached. Defaults to- NA_real_.
- loaded
- logicalThe initial loaded value. This is used to determine if the feature is loaded (or not) or not the map. Defaults to- FALSE.
- parameters
- listof Parameter objects.
- statistics
- listof Statistic objects.
- theme_results
- listof ThemeResults objects.
- weight_results
- listof WeightResults objects.
- include_results
- listof IncludeResults objects.
- exclude_results
- listof ExcludeResults objects.
- id
- characterunique identifier. Defaults to a random identifier (- uuid::UUIDgenerate()).
- logicalshould the solution be hidden from map?
- downloadable
- logicalcan the solution be downloaded?
- pane
- characterunique map pane identifier. Defaults to a random identifier (- uuid::UUIDgenerate()) concatenated with layer index.
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)
# create variables
v1 <- new_variable_from_auto(dataset = d, index = 1)
v2 <- new_variable_from_auto(dataset = d, index = 2)
# create features using variables
f1 <- new_feature(
  name = "Possum", variable = v2,
  goal = 0.2, status = FALSE, current = 0.5, id = "F1"
)
# create themes using the features
t1 <- new_theme("Species", f1, id = "T1")
# create a feature results object to store results for the feature
fr1 <- new_feature_results(f1, held = 0.8)
# create a theme results object to store results for the feature
tr1 <- new_theme_results(t1, fr1)
# create parameters
p1 <- new_parameter(name = "Spatial clustering")
p2 <- new_parameter(name = "Optimality gap")
# create a new solution
s <- new_solution(
  name = "solution001",
  variable = v2,
  visible = TRUE,
  parameters = list(p1, p2),
  statistics = list(),
  theme_results = list(tr1),
  weight_results = list(),
  include_results = list(),
  exclude_results = list(),
  id = "solution1",
  hidden = FALSE,
  downloadable = TRUE
)