parse_api_data: General function to parse 'api_data' objects

Description Usage Arguments Value Author(s) See Also Examples

Description

It is a generic function to parse 'api_data' object ('xxx_geocode', 'xxx_revgeocode', or 'xxx_geohost'). You can mix 'api_data' objects of different subclasses for parsing, while the three 'api_data' parsers mentioned in 'seealso' can only parse objects of the same subclass.

Usage

1

Arguments

x

'api_data' objects, typically lists yieled by get_api_data().

...

other arguments to pass to the function. Refer to the functions in 'seealso' to know more about available optional arguments.

Value

a list comprising of tibbles. Since the 'api_data' objects may be of different subclasses, it is not reasonable to coerce the results into a single data.frame. If the mixed parsing fails somewhere, you will not get any result.

Author(s)

Yiying Wang, wangy@aetna.com

See Also

parse_geohosts(), parse_geocodes() and parse_revgeocodes()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
# get a bunch of 'api_data' objects
library(asesgeo)
x1 <- geohost('<ip1>', output='raw')
x2 <- geocode('<addr1>', output='raw')
x3 <- revgeocode('<latlng1>', output='raw')

parse_api_data(c(x1, x2, x3))

## End(Not run)

madlogos/aseskit documentation built on June 26, 2019, 12:17 a.m.