tbl_xyz2mat: convert xyz tbl to matrix

tbl_xyz2matR Documentation

convert xyz tbl to matrix

Description

convert xyz tbl to matrix

Usage

tbl_xyz2mat(tbl, x = 1, y = 2, z = 3)

Arguments

tbl

A tibble,data.frame or sf object.

x

(optional) The x-axis coordinates column number, default is 1.

y

(optional) The y-axis coordinates column number, default is 2.

z

(optional) The z (attribute) coordinates column number, default is 3.

Value

A list.

z_attrs_matrix

A matrix with attribute information.

x_coords_matrix

A matrix with the x-axis coordinates.

y_coords_matrix

A matrix with the y-axis coordinates.

Examples

set.seed(42)
lon = rep(1:3,each = 3)
lat = rep(1:3,times = 3)
zattr = rnorm(9, mean = 10, sd = 1)
demodf = data.frame(x = lon, y = lat, z = zattr)
demodf
tbl_xyz2mat(demodf)


sdsfun documentation built on April 3, 2025, 8:39 p.m.