powered by
convert xyz tbl to matrix
tbl_xyz2mat(tbl, x = 1, y = 2, z = 3)
A list.
list
A matrix with attribute information.
A matrix with the x-axis coordinates.
A matrix with the y-axis coordinates.
A tibble,data.frame or sf object.
tibble
data.frame
sf
(optional) The x-axis coordinates column number, default is 1.
1
(optional) The y-axis coordinates column number, default is 2.
2
(optional) The z (attribute) coordinates column number, default is 3.
3
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)
Run the code above in your browser using DataLab