View source: R/balance_check.R
get_coords | R Documentation |
Add coordinates to the data slot of a SpatialPointsDataFrame
get_coords(
points,
x_var = "XMETERS",
y_var = "YMETERS",
projection =
"+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=37.5 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"
)
points |
A point sf object. The coordinates will be extracted for these points. Note: a multipoint sf object will not work. |
x_var |
Character string. The name of the variable to add the x component of the coordinates to in |
y_var |
Character string. The name of the variable to add the y component of the coordinates to in |
projection |
Character string. The projection to use when determining the coordinates. Defaults to |
The sf object provided as points
with the coordinates added to the variables defined with x_var
and y_var
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.