as.json: Convert inputs to JSON

Description Usage Arguments Details Examples

View source: R/as.json.R

Description

Convert inputs to JSON

Usage

1

Arguments

x

Input

...

Further args passed on to jsonlite::toJSON()

Details

when the output of topojson_list() is given to this function we use a special internal fxn astjl() to parse the object - see that fxn and let us know if any problems you run in to

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
(res <- geojson_list(us_cities[1:2,], lat='lat', lon='long'))
as.json(res)
as.json(res, pretty = TRUE)

vec <- c(-99.74,32.45)
as.json(geojson_list(vec))
as.json(geojson_list(vec), pretty = TRUE)

## End(Not run)

geojsonio documentation built on Jan. 15, 2021, 3:33 p.m.

Related to as.json in geojsonio...