Since (I think) NA in geometry is not supported, you can bind_rows
the data frames and then add on the geometry and convert.
nc1
and nc2
are two sf objects with differing columns:
> nc1
Simple feature collection with 100 features and 2 fields
geometry type: MULTIPOLYGON
dimension: XY
bbox: xmin: -84.32385 ymin: 33.88199 xmax: -75.45698 ymax: 36.58965
epsg (SRID): 4267
proj4string: +proj=longlat +datum=NAD27 +no_defs
First 20 features:
NWBIR74 BIR79 geometry
1 10 1364 MULTIPOLYGON(((-81.47275543...
2 10 542 MULTIPOLYGON(((-81.23989105...
3 208 3616 MULTIPOLYGON(((-80.45634460...
4 123 830 MULTIPOLYGON(((-76.00897216...
5 1066 1606 MULTIPOLYGON(((-77.21766662...
6 954 1838 MULTIPOLYGON(((-76.74506378...
> nc2
Simple feature collection with 100 features and 2 fields
geometry type: MULTIPOLYGON
dimension: XY
bbox: xmin: -84.32385 ymin: 33.88199 xmax: -75.45698 ymax: 36.58965
epsg (SRID): 4267
proj4string: +proj=longlat +datum=NAD27 +no_defs
First 20 features:
SID79 NWBIR79 geometry
1 0 19 MULTIPOLYGON(((-81.47275543...
2 3 12 MULTIPOLYGON(((-81.23989105...
3 6 260 MULTIPOLYGON(((-80.45634460...
4 2 145 MULTIPOLYGON(((-76.00897216...
5 3 1197 MULTIPOLYGON(((-77.21766662...
Then I can do this:
vv = bind_rows(data.frame(nc1),data.frame(nc2))
vv$geometry=c(nc1$geometry, nc2$geometry)
vv = st_as_sf(vv)
Which has the NA padding - head:
First 20 features:
NWBIR74 BIR79 SID79 NWBIR79 geometry
1 10 1364 NA NA MULTIPOLYGON(((-81.47275543...
2 10 542 NA NA MULTIPOLYGON(((-81.23989105...
3 208 3616 NA NA MULTIPOLYGON(((-80.45634460...
4 123 830 NA NA MULTIPOLYGON(((-76.00897216...
5 1066 1606 NA NA MULTIPOLYGON(((-77.21766662...
tail:
proj4string: +proj=longlat +datum=NAD27 +no_defs
NWBIR74 BIR79 SID79 NWBIR79 geometry
195 NA NA 4 487 MULTIPOLYGON(((-77.14895629...
196 NA NA 5 1023 MULTIPOLYGON(((-78.26149749...
197 NA NA 3 763 MULTIPOLYGON(((-78.02592468...
198 NA NA 17 1832 MULTIPOLYGON(((-78.65571594...
199 NA NA 9 2100 MULTIPOLYGON(((-77.96073150...
200 NA NA 6 841 MULTIPOLYGON(((-78.65571594...