Skip to content

Commit 199be05

Browse files
transform all the sfc columns independently (tidyverse#4382)
1 parent be50f53 commit 199be05

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

R/coord-sf.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ CoordSf <- ggproto("CoordSf", CoordCartesian,
6262
return(layer_data)
6363
}
6464

65-
sf::st_transform(layer_data, params$crs)
65+
idx <- vapply(layer_data, inherits, what = "sfc", FUN.VALUE = logical(1L))
66+
layer_data[idx] <- lapply(layer_data[idx], sf::st_transform, crs = params$crs)
67+
layer_data
6668
})
6769
},
6870

0 commit comments

Comments
 (0)