[R] how to standardize raster image (GeoTiff) in R?
Angela Smith
angela.smith2071 at hotmail.com
Tue Feb 24 00:18:59 CET 2015
Hi R user,
Would you give me some hints on to standardize the raster image (GeoTiff). I used the following code but did not work. would you give me some hints on it?
#----------------------------------
#code
# center with 'apply()'
center_apply <- function(x) {
apply(x, 2, function(y) y - mean(y))
}
# import data
im1<-("image1.tif")
im2<-("image2.tif")
image<-stack(im1,im2)
# standardize (a mean of zero and unit variance) of the rasetr images
st<-center_apply(image)
but it did not work. any suggestions?
[[alternative HTML version deleted]]
More information about the R-help
mailing list