My goal is to create an im
object from terrain elevation data (pp3
's z-axis), similar to bei.extra
($elev
and $grad
). I started by creating a pp3
object from my data set:
x <- elev_test$x
y <- elev_test$y
z <- elev_test$z
X <- pp3(x, y, z, c(0, 102), c(0, 152), c(90, 102))
plot(X)
Then I tried to coerce the pp3
object to class im
, but as.im
threw an error:
> Elev_im <- as.im(X)
Error in as.im.default(X) : Can't convert X to a pixel image
How can I obtain the desired im
object?