 Please list what version of raster you are using. A bug was submitted and
corrected on this issue
sometime ago so I suspect you may have an old version.

sessionInfo()   please when you have a question.



On Tue, Nov 1, 2011 at 8:36 AM, Aidin Niamir <niamir@gmail.com> wrote:

> Dear all
>
> I am experiencing a strange problem when calculating in the raster package.
> Let me explain it with a simple expample;
>
> > a <- c(1,1,1,0,0,0,2,2,2)
> > a <- matrix(a,3,3,byrow=T)
> > a <- raster(a)
> > a []
> [1] 1 1 1 0 0 0 2 2 2
> > b <- 10 - a
> > b []
> [1]  -9  -9  -9 -10 -10 -10  -8  -8  -8
>
> As you can see, the obtained values are not correct. I cannot see why this
> should be.
> Can anybody help?
>
> Aidin
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

