Writing an sf object to file

Use st_write():

tempfile_geojson <- tempfile(fileext = ".geojson")
st_write(nc_points, tempfile_geojson)
## Writing layer `filecaea36096cce' to data source 
##   `/tmp/RtmpQbbBHt/filecaea36096cce.geojson' using driver `GeoJSON'
## Writing 10 features with 0 fields and geometry type Point.

Read back in with:

st_read(tempfile_geojson)