diff --git a/NAMESPACE b/NAMESPACE index b7af0d2f4..d96a9c830 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -358,6 +358,7 @@ S3method(str,sfc) S3method(summary,sfc) S3method(t,sgbp) S3method(text,sf) +S3method(text,sfc) S3method(transform,sf) S3method(vec_cast.sfc,default) S3method(vec_cast.sfc,sfc) diff --git a/NEWS.md b/NEWS.md index e8f99ebdb..8c25b3ddc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,6 @@ # version 1.0-17 -* `text.sf()` adds labels to base plots at geometry centroids; #2399 +* `text.sf()` and `text.sfc()` add labels to base plots at geometry centroids; #2399 * `st_sf()` no longer strips `tbl` or `tbl_df` class labels; #2378 diff --git a/man/plot.Rd b/man/plot.Rd index fd80abf2a..1a832e42f 100644 --- a/man/plot.Rd +++ b/man/plot.Rd @@ -17,6 +17,7 @@ \alias{plot_sf} \alias{sf.colors} \alias{text.sf} +\alias{text.sfc} \title{plot sf object} \usage{ \method{plot}{sf}( @@ -155,7 +156,9 @@ plot_sf( sf.colors(n = 10, cutoff.tails = c(0.35, 0.2), alpha = 1, categorical = FALSE) -\method{text}{sf}(x, labels = row.names(x), ..., of_largest_polygon = FALSE) +\method{text}{sf}(x, labels = row.names(x), ...) + +\method{text}{sfc}(x, labels = seq_along(x), ..., of_largest_polygon = FALSE) } \arguments{ \item{x}{object of class sf}