| SpatialModel | R Documentation |
R6 class representing a generic (abstract)
spatially-explicit model. It extends GenericModel with the addition of
a study region specification.
poems::GenericClass -> poems::GenericModel -> SpatialModel
attachedA list of dynamically attached attributes (name-value pairs).
model_attributesA vector of model attribute names.
regionA Region (or inherited class) object specifying the study region.
coordinatesData frame (or matrix) of X-Y population (WGS84) coordinates in longitude (degrees West) and latitude (degrees North) (get and set), or distance-based coordinates dynamically returned by region raster (get only).
attribute_aliasesA list of alternative alias names for model attributes (form: alias = "attribute") to be used with the set and get attributes methods.
error_messagesA vector of error messages encountered when setting model attributes.
warning_messagesA vector of warning messages encountered when setting model attributes.
new()Initialization method sets given attributes individually and/or from a list.
SpatialModel$new(region = NULL, ...)
regionA Region (or inherited class) object specifying the study region.
...Parameters passed individually.
new_clone()Creates a new (re-initialized) object of the current (inherited) object class with optionally passed parameters.
SpatialModel$new_clone(...)
...Parameters passed via the inherited class constructor (defined in initialize and run via new).
New object of the current (inherited) class.
clone()The objects of this class are cloneable with this method.
SpatialModel$clone(deep = FALSE)
deepWhether to make a deep clone.
# U Island example region
coordinates <- data.frame(
x = rep(seq(177.01, 177.05, 0.01), 5),
y = rep(seq(-18.01, -18.05, -0.01), each = 5)
)
template_raster <- Region$new(coordinates = coordinates)$region_raster # full extent
template_raster[][-c(7, 9, 12, 14, 17:19)] <- NA # make U Island
region <- Region$new(template_raster = template_raster)
# Example spatial model
model1 <- SpatialModel$new(region = region, a_layers = 3)
model1$coordinates
model1$set_attributes(a_values = array(8:28, c(7, 3)))
model1$region$raster_from_values(model1$get_attribute("a_values"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.