Geography properties for crunch variables
Crunch stores geographic data as variable metadata. There are a number of functions that help access and change this metadata.
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())
... |
for |
data |
for |
x |
a crunch variable |
value |
value of the geography property to set |
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 match match_field
(e.g. properties.name)
match_field
a character string representing the variable metadata information which is used
to match feature_key
to (e.g. name)
geographic information of class CrunchGeography
(NULL
if there is none)
## Not run: geo(ds$location) geo(ds$location)$feature_key <- "properties.name" geo(ds$location)$match_field <- "name" ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.