latlong_as_xy {CRTspat}R Documentation

Convert lat long co-ordinates to x,y

Description

latlong_as_xy converts co-ordinates expressed as decimal degrees into x,y

Usage

latlong_as_xy(trial, latvar = "lat", longvar = "long")

Arguments

trial

A trial dataframe or list of class "CRTsp" containing latitudes and longitudes in decimal degrees

latvar

name of column containing latitudes in decimal degrees

longvar

name of column containing longitudes in decimal degrees

Details

The output object contains the input locations replaced with Cartesian coordinates in units of km, centred on (0,0), corresponding to using the equirectangular projection (valid for small areas). Other data are unchanged.

Value

A list of class "CRTsp" containing the following components:

geom_full list: summary statistics describing the site
trial data frame: rows correspond to geolocated points, as follows:
x numeric vector: x-coordinates of locations
y numeric vector: y-coordinates of locations
... other objects included in the input "CRTsp" object or data frame

Examples

examplexy <- latlong_as_xy(readdata("example_latlong.csv"))


[Package CRTspat version 1.3.0 Index]