coordmove: Move Coordinates

Description Usage Arguments Value See Also Examples

View source: R/coordmove.R

Description

Move coordinates in the x and y direction in the plane.

Usage

1
coordmove(pts, from, to)

Arguments

pts

A numeric matrix with two columns of x and y coordinates to be moved.

from

A numeric vector of length 2, the starting x and y coordinates of a point.

to

A numeric vector of length 2, the ending x and y coordinates of a point.

Value

A numeric matrix with same dimension as pts with the moved x and y coordinates.

See Also

coordplot, coordturn, coordflip, coordtri.

Examples

1
2
3
4
5
6
test <- matrix(c(0, 4, 1, 0, 2, 3), ncol=2,
 dimnames=list(LETTERS[1:3], NULL))
coordplot(test)
# move the coordinates so that the second point is at the origin
mtest <- coordmove(test, test[2, ], c(0, 0))
coordplot(mtest)

JVAdams/jvamisc documentation built on Aug. 11, 2021, 6:43 a.m.