CrunchGeography-class {crunch} | R Documentation |
Geography properties for crunch variables
Description
Crunch stores geographic data as variable metadata. There are a number of functions that help access and change this metadata.
Usage
CrunchGeography(..., data = NULL)
geo(x)
geo(x) <- value
## S4 method for signature 'CrunchVariable'
geo(x)
## S4 replacement method for signature 'CrunchVariable,CrunchGeography'
geo(x) <- value
## S4 replacement method for signature 'CrunchVariable,'NULL''
geo(x) <- value
availableGeodata(x = getAPIRoot())
Arguments
... |
for |
data |
for |
x |
a crunch variable |
value |
value of the geography property to set |
Details
geo
retrieves the geographic information associate with a variable.
If there is geographic information it returns an object of class
CrunchGeography
otherwise it returns NULL
.
CrunchGeography
objects store geography metadata from a variable. There are three slots:
-
geodatum
an object of class CrunchGeodata which stores references to the Crunch-hosted (geo|topo)json to use -
feature_key
a character string representing the feature inside of the (geo|topo)json which is used to matchmatch_field
(e.g. properties.name) -
match_field
a character string representing the variable metadata information which is used to matchfeature_key
to (e.g. name)
Value
geographic information of class CrunchGeography
(NULL
if there is none)
Examples
## Not run:
geo(ds$location)
geo(ds$location)$feature_key <- "properties.name"
geo(ds$location)$match_field <- "name"
## End(Not run)