add_coords: Adding coordinate variables to an sf points object

View source: R/spatial_manipulation.R

add_coordsR Documentation

Adding coordinate variables to an sf points object

Description

Adds one or more of the following: the coordinates from the current coordinate reference system; coordinates in NAD83; and coordinates in Albers Equal Area. This does not change the projection of the points.

Usage

add_coords(
  points,
  coord_names = c("x_coord", "y_coord"),
  nad83 = FALSE,
  albers = FALSE
)

Arguments

points

A points sf object. The coordinates for the points will be added for at least the current projection.

coord_names

Character vector. The names for the coordinate variables using the CRS of points. Format is c("name for x coord", "name for y coord"). Defaults to c("x_coord", "y_coord").

nad83

Logical. If TRUE Then the variables LONGITUDE_NAD83 and LATITUDE_NAD83 will be added using NAD83 as the CRS. Defaults to FALSE.

albers

Logical. If TRUE Then the variables X_METERS_AL and Y_METERS_AL will be added using Albers Equal Area as the CRS. Defaults to FALSE.

Value

points with coordinate fields added to the data frame as requested.


nstauffer/aim.analysis documentation built on Nov. 20, 2024, 8:38 a.m.