Convert lat long co-ordinates to x,y
latlong_as_xy.Rd
latlong_as_xy
converts co-ordinates expressed as decimal degrees into x,y
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
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 |
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.
Examples
examplexy <- latlong_as_xy(readdata("example_latlong.csv"))