R6 class representing a spatial model
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
attached
A list of dynamically attached attributes (name-value pairs).
model_attributes
A vector of model attribute names.
region
A Region
(or inherited class) object specifying the study region.
coordinates
Data 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_aliases
A list of alternative alias names for model attributes (form: alias = "attribute"
) to be used with the set and get attributes methods.
error_messages
A vector of error messages encountered when setting model attributes.
warning_messages
A 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, ...)
region
A 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)
deep
Whether 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"))
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.