Learn R Programming

geojson (version 0.3.5)

geo_write: Write geojson to disk

Description

Write geojson to disk

Usage

geo_write(x, file)

Arguments

x

input, an object of class geojson

file

(character) a file path, or connection

Details

Wrapper around jsonlite::toJSON() and cat

Examples

Run this code
file <- tempfile(fileext = ".geojson")
geo_write(
  point('{ "type": "Point", "coordinates": [100.0, 0.0] }'),
  file
)
readLines(file)
unlink(file)

Run the code above in your browser using DataLab