Learn R Programming

geojsonio (version 0.1.8)

as.json: Convert inputs to JSON

Description

Convert inputs to JSON

Usage

as.json(x, ...)

Arguments

x
Input
...
Further args passed on to toJSON

Examples

Run this code
## 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)

Run the code above in your browser using DataLab