add_coords: Adding coordinate variables to the data frame of a...

View source: R/manipulation.R

add_coordsR Documentation

Adding coordinate variables to the data frame of a SpatialPointsDataFrame

Description

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

Usage

add_coords(
  spdf,
  current.proj = TRUE,
  xynames = NULL,
  nad83 = FALSE,
  albers = FALSE
)

Arguments

spdf

A SpatialPointsDataFrame to add the coordinates to

current.proj

Logical. If TRUE Then the columns coords.x1 and coords.x2 will be added using the current projection. Defaults to TRUE.

xynames

Optional vector of two character strings to rename the coordinate variables from the current projection. Format is c("replacement for coords.x1", "replacement for coords.x2").

nad83

Logical. If TRUE Then the columns LONGITUDE.NAD83 and LATITUDE.NAD83 will be added using NAD83. Defaults to FALSE.

albers

Logical. If TRUE Then the columns X.METERS.AL and Y.METERS.AL will be added using Albers Equal Area. Defaults to FALSE.

Value

spdf with fields added to the data frame as requested.


nstauffer/aim.analysis documentation built on Nov. 2, 2023, 12:52 a.m.