df.to.mat {EFDR} | R Documentation |
Change xyz data-frame into a Z image
Description
Given a data frame with fields x, y
and z
, df.to.mat
uses the x
and
y
coordinates to rearrange z
into a rectangular matrix image Z
.
Usage
df.to.mat(df)
Arguments
df |
data frame with fields |
Details
This function requires that all pixels in the image are defined, that is df$x
and df$y
must be the
column outputs of the function expand.grid(x0,y0)
where x0, y0
are axes values. Note that x0
and
y0
do not need to be regularly spaced.
Value
matrix image
Examples
df <- data.frame(expand.grid(1:10,1:10))
names(df) <- c("x","y")
df$z <- rnorm(nrow(df))
Z <- df.to.mat(df)
[Package EFDR version 1.3 Index]