Joining sf object with data (1)

This can be done with the *_join() functions from dplyr.

Example based on vignette 4 from sf.

x <- st_sf(a = 1:2, geom = st_sfc(st_point(c(0, 0)), st_point(c(1, 1))))
y <- data.frame(a = 2:3, letter = letters[11:12])
x
## Simple feature collection with 2 features and 1 field
## Geometry type: POINT
## Dimension:     XY
## Bounding box:  xmin: 0 ymin: 0 xmax: 1 ymax: 1
## CRS:           NA
##   a        geom
## 1 1 POINT (0 0)
## 2 2 POINT (1 1)
y
##   a letter
## 1 2      k
## 2 3      l