Learn R Programming

sf (version 0.0)

sf: create sf object

Description

create sf, which extends data.frame-like objects with a simple feature list column

Usage

sf(df)

Arguments

df
object of class data.frame

Examples

Run this code
pt1 = POINT(c(0,1))
pt2 = POINT(c(1,1))
sfc(list(pt1, pt2))
d = data.frame(a = 1:2)
d$geom = sfc(list(pt1, pt2))
df = sf(d)
d$geom2 = sfc(list(pt1, pt2))
sf(df) # warns

Run the code above in your browser using DataLab