View source: R/geomultistar_define_geoattribute.R
define_geoattribute | R Documentation |
Defines a geographic attributes in two possible ways: Associates the
instances of attributes of the geographic dimension with the instances of a
geographic layer or defines it from the geometry of another previously
defined geographic attribute. Multiple attributes can be specified in the
attribute
parameter.
define_geoattribute(
gms,
dimension = NULL,
attribute = NULL,
additional_attributes = NULL,
from_layer = NULL,
by = NULL,
from_attribute = NULL
)
## S3 method for class 'geomultistar'
define_geoattribute(
gms,
dimension = NULL,
attribute = NULL,
additional_attributes = NULL,
from_layer = NULL,
by = NULL,
from_attribute = NULL
)
gms |
A |
dimension |
A string, dimension name. |
attribute |
A vector, attribute names. |
additional_attributes |
A vector, attribute names. |
from_layer |
A |
by |
a vector of correspondence of attributes of the dimension with the
|
from_attribute |
A string, attribute name. |
If defined from a layer (from_layer
parameter), additionally the attributes
used for the join between the tables (dimension and layer tables) must be
indicated (by
parameter).
If defined from another attribute, it should have a finer granularity, to obtain the result by grouping its instances.
If no value is indicated in the attribute
parameter, it is defined for all
those attributes of the dimension that do not have any previous definition,
they are obtained from the attribute indicated in the from_attribute
parameter.
A geomultistar
object.
Other geo functions:
geomultistar()
,
get_empty_geoinstances()
,
run_geoquery()
gms <- geomultistar(ms = ms_mrs, geodimension = "where") |>
define_geoattribute(
attribute = "city",
from_layer = usa_cities,
by = c("city" = "city", "state" = "state")
)
gms <- gms |>
define_geoattribute(attribute = c("region", "all_where"),
from_attribute = "city")
gms <- gms |>
define_geoattribute(from_attribute = "city")
gms <- gms |>
define_geoattribute(attribute = "all_where",
from_layer = usa_nation)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.