polygons_to_sf: Convert sf-optional polygons to an sf data frame

View source: R/atlas_polygons.R

polygons_to_sfR Documentation

Convert sf-optional polygons to an sf data frame

Description

Inverse of sf_to_polygons(). Uses sfheaders::sf_multipolygon() to build MULTIPOLYGON geometries — sfheaders is pure Rcpp and has no GDAL/GEOS/PROJ system dependencies, so the conversion itself does not require a full sf installation. The returned object is an sf-class data frame, which downstream users would manipulate using sf.

Usage

polygons_to_sf(polygons)

Arguments

polygons

A brain_polygons data.frame produced by sf_to_polygons() or constructed directly: one row per label, with a geometry list-column of data.frames containing view, x, y, group, subgroup.

Value

An sf-class data frame with columns label, view, geometry (one row per label×view, geometry is MULTIPOLYGON).

Internal conversion primitive. For the atlas-level public API use as_sf_atlas() / atlas_sf().


ggseg.formats documentation built on July 2, 2026, 5:07 p.m.