xyTransform: Convert a coordinate pair to a different coordinate system

Description Usage Arguments Value Examples

View source: R/convertformats.R

Description

Converts a single coordinate pair to a different coordinate system

Usage

1
xyTransform(coords, proj1, proj2)

Arguments

coords

A vector of length 2 with the coordinates

proj1

The CRS of the input coordinates

proj2

The target CRS of the output coordinates

Value

A vector of length 2 with the converted coordinate pair.

Examples

1
2
3
bng <- CRS("+init=epsg:27700") # British National Grid
lonlat <- CRS("+init=epsg:4326") # LatLon WGS84
xyTransform(c(345600,378200), bng, lonlat)

ahb108/sparch documentation built on Feb. 3, 2021, 1:21 a.m.