knitr::opts_chunk$set(collapse = TRUE)
if (file.exists("nc1.shp"))
    file.remove("nc1.shp", "nc1.dbf", "nc1.shx", "nc1.prj")

st_read

library("sf")
fname <- system.file("shape/nc.shp", package = "sf")
nc <- st_read(fname)

st_write

st_write(nc, "nc1.shp")
file.exists("nc1.shp")

Conversion to and from sp

library("sp")
data(meuse)
coordinates(meuse) = ~x+y
m.sf = st_as_sf(meuse)
opar = par(mar=rep(0,4))
plot(m.sf)

units

library("units")
as_units("mm")


o2r-project/containerit documentation built on June 28, 2021, 2:46 p.m.