LLtoUTM: Convert Latitude and Longitude spatial coordinates to TM...

Description Usage Arguments Details Value Examples

View source: R/LLtoUTM.R

Description

The resulting units from applying the function are kilometers.

Usage

1
2
LLtoUTM(cm, lat, lon, xcol = "x", ycol = "y", minx = NULL,
  miny = NULL)

Arguments

cm

is the user defined central median, often taken to be the mean of the longitude values

lat

is the vector of latitudes

lon

is the vector of longitudes

xcol

is the name of the output column of x coordinates

ycol

is the name of the output column of y coordinates

minx

is 'NULL' by default

miny

is 'NULL' by default

Details

This function only needs to be used if the coordinates supplied by the user are latitude and longitude. If the coordinates are UTM, then we should not use this function.

Value

A list with the TM coordinates as the first component of the list. The first component of the list contains x coordinates in the first column and y coordinates in the second column

Examples

1
2
3
4
5
6
7
8
## Add TM x and y coordinates to a data frame with
## latitude/longitude coordinates
exampledataset$xc_TM_ <- LLtoUTM(cm = base::mean(exampledataset[ ,"xcoords"]),
 lat = exampledataset[ ,"ycoords"],
 lon = exampledataset[ ,"xcoords"])$xy[ ,1]
exampledataset$yc_TM_ <- LLtoUTM(cm = base::mean(exampledataset[ ,"xcoords"]),
 lat = exampledataset[ ,"ycoords"],
 lon = exampledataset[ ,"xcoords"])$xy[ ,2]

highamm/FPBK-with-Detection documentation built on Jan. 2, 2022, 6:35 a.m.