Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

geo

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 CrunchGeography, named arguments from which to construct a CrunchGeography: geodatum, feature_key, and match_field

data

for CrunchGeography, list of named arguments from which to construct a CrunchGeography: geodatum, feature_key, and match_field

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 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)

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)

crunch

Crunch.io Data Tools

v1.28.0
LGPL (>= 3)
Authors
Greg Freedman Ellis [aut, cre], Jonathan Keane [aut], Mike Malecki [aut], Neal Richardson [aut], Gordon Shotwell [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.