xyConv: Convert xy coordinates from one projection to another.

Description Usage Arguments Value Author(s) Examples

Description

Takes a dataframe with XY coordinates as input and converts the coordinates to another projection system. The function defaults to converting longlat to UTM zone 11, however any properly formated CRS string is acceptable for input.

Usage

1
2
xyConv(df, xy = c("long_x", "lat_y"), CRSin = "+proj=longlat",
  CRSout = "+proj=utm +zone=11", outclass = "data.frame")

Arguments

df

A dataframe that contains x, y coordinates.

xy

A vector of the names for the input x and y coordinates. Default is long_x and lat_y

CRSin

The CRS string of the input coordinates, defaults to longlat

CRSout

The CRS string of the output coordinates, defaults to UTM Zone 11

outclass

The class of the data object to be returned. Options include 'data.frame', 'data.table', and 'spdf'. 'spdf' returns an object of class sp::SpatialPointsDataFrame.

Value

the original data.table, data.frame or SpatialPointsDataFrame with converted XY coordinates added to the object.

Author(s)

Mitchell Gritts

Examples

1
df <- xyConv(dat, xy = c('geox', 'geoy'))

ndow-wisr/wildlife_tools documentation built on May 23, 2019, 1:29 p.m.