array_to_xyz: Convert an Array to xyz Coordinates

Description Usage Arguments Value Examples

View source: R/array_to_xyz.R

Description

This function takes a 2 or 3 dimensional image array and returns a matrix containing values in the array along with their xyz coordinates within the array. The xyz coordinates of a value will correspond to its indices in the original array. This is useful for assigning xyz coordinates to values in a raster image in order to find spacial data.

Usage

1

Arguments

array

an 2 or 3-dimensional array

Value

matrix

Examples

1
2
test_array <- array(c(1,2,3,4), dim = c(2,2))
array_to_xyz(test_array)

HarpethLee/LSMFunc documentation built on Dec. 17, 2021, 10:30 p.m.