# NOT RUN {
library(raster)
r <- raster(nrows=100, ncols=100, xmn=571823, xmx=616763,
ymn=4423540, ymx=4453690)
r[] <- runif(ncell(r), 1000, 2500)
# Postive values so, can apply any transformation
for( i in c("norm", "rstd", "std", "stretch", "nl", "slog", "sr")) {
print( raster.transformation(r, trans = i) )
}
# Negative values so, can't transform using "nl", "slog" or "sr"
r[] <- runif(ncell(r), -1, 1)
for( i in c("norm", "rstd", "std", "stretch", "nl", "slog", "sr")) {
try( print( raster.transformation(r, trans = i) ) )
}
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab