new_include_results: New include results

View source: R/class_IncludeResults.R

new_include_resultsR Documentation

New include results

Description

Create a new IncludeResults object to store results for a solution.

Usage

new_include_results(include, held, id = uuid::UUIDgenerate())

Arguments

include

Weight object.

held

numeric proportion of the include covered by the solution. (e.g. 0.1 = 10%).

id

character unique identifier. Defaults to a random identifier (uuid::UUIDgenerate()).

Value

A IncludeResults object.

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 new variable
v <- new_variable_from_auto(d, index = 1)

# create a new include
i <- new_include(name = "NDVI", variable = v)

# create a new include results object to store results
ir <- new_include_results(i, 80)

# print object
print(ir)

NCC-CNC/wheretowork documentation built on Feb. 27, 2025, 6:11 p.m.