df.to.mat {EFDR} | R Documentation |
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
.
df.to.mat(df)
df |
data frame with fields |
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.
matrix image
df <- data.frame(expand.grid(1:10,1:10))
names(df) <- c("x","y")
df$z <- rnorm(nrow(df))
Z <- df.to.mat(df)