
getXY(x, y = NULL, unidim.allowed = TRUE)
x
is a vector,
the second dimension may be defined by argument y
. If
x
is a matrix, dataframe or list and a second column or
element exists, this second element isx
.
\crWhenargument x
is onedimensional, argument y
does
not exist and unidim.allowed is TRUE, argument x
is
coerced to a vector and returned getXY
behaves very similar to xy.coord
x
and y
x
is a list, the
first two elements must have identical length. When y
is
defined, x
must be one dimensional and must have the same
length as argument y
. When onedim.allowed
is
FALSE, input must be twodimensional.
When input is one dimensional and unidim
is TRUE, y
gives the numbers of elements back.
Function works similar to xy.coords
getXY(3:4, 1:2)
getXY(matrix(1:4,ncol=2))
getXY(as.data.frame(matrix(1:4,ncol=2)))
getXY(4:1)
getXY(list(a=1:2,b=9:10))
Run the code above in your browser using DataLab