# NOT RUN {
library(raster)
# create a raster object with outliers
data <- c(runif(98,-10,10), -1000, 1000)
data <- matrix(data, ncol=10)
data <- raster::raster(data)
# compute upper and lower threshold values for outliers
threshold.values <- intFun.grid.define.outlier(data, 2)
# Set all values outside the outlier range to NA
outlier.points <- intFun.grid.outliers.points(data, threshold.values[1], threshold.values[2])
plot(data); points(outlier.points)
# }
Run the code above in your browser using DataLab