Converts point coordinates stored in an sf object to columns for both the x and y coordinates. Useful for storing spatial data in tabular form.

gw_get_coords(.data, names = c("x","y"), crs = 4269)

Arguments

.data

A sf object

names

A vector with two column names, one for the x coordinate and one for the y coordinate.

crs

A numeric code corresponding to the desired coordinate system for the column output

Value

An updated object with two new columns based on the names provided in the names argument.

Details

Based on a function written Josh M. London and described in a GitHub issue.