# NOT RUN {
library(raster)
data(elev)
# calculate tpi and plot
tpi9 <- tpi(elev, scale=9)
par(mfrow=c(1,2))
plot(elev, main="original raster")
plot(tpi9, main="tpi 9x9")
# }
Run the code above in your browser using DataLab