Take a look at im1 and im2. You will find that they are just the
quoted names. You have imported nothing.
Have you made any effort to read R's or the GeoTiff's tutorials? --
you appear to not have a clue about how either works. Also see
?scale, which will do what you appear to want much much faster.
Cheers,
Bert
Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374
"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
Clifford Stoll
On Mon, Feb 23, 2015 at 3:18 PM, Angela Smith
<angela.smith2071 at hotmail.com> wrote:> 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]]
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.