Erin,

This is not a good approach:

min1 <- min(a@data@values,b@data@values)
max1 <- max(a@data@values,b@data@values)

Because many RasterLayer objects won't have any values there. It is
another example of why you should not poke inside of S4 objects if
there are functions to do that for you.
This is a better approach:

min1 <- min(minValue(a), minValue(b))
max1 <- max(maxValue(a), maxValue(b))

Robert


On Fri, Jul 25, 2014 at 12:09 PM, Hodgess, Erin <hodge...@uhd.edu> wrote:
> Sure!
>
>
>
> No prob:
>
>
>
> min1 <- min(a@data@values,b@data@values<mailto:a@data@values,b@data@values>)
>
> max1 <- max(a@data@values,b@data@values<mailto:a@data@values,b@data@values>)
>
> bk1 <- seq(from=min1,to=max1,len=6)  #note: make the len whatever you wish
>
> par(mfrow=c(1,2))
>
> plot(a,breaks=bk1)
>
> plot(b,breaks=bk1)
>
>
>
> Thanks!
>
>
>
> I'm glad to hear that somebody else might use it....thought I was just being 
> a complete doofus!
>
>
>
> Take care,
>
> Erin
>
>
>
> ________________________________
> From: Michael Treglia [mtreg...@gmail.com]
> Sent: Friday, July 25, 2014 1:42 PM
> To: Hodgess, Erin
> Cc: r-sig-geo@r-project.org
> Subject: Re: [R-sig-Geo] raster plotting question: figured it out
>
> Hey Erin,
> Could you please include the solution? I haven't had to do that, but I'm sure 
> that I (and others) will probably have to in the future, so it may be useful 
> to have the solution in this thread
> Thanks!
> Mike
>
>
> On Fri, Jul 25, 2014 at 2:25 PM, Hodgess, Erin 
> <hodge...@uhd.edu<mailto:hodge...@uhd.edu>> wrote:
> Sorry for the trouble.
>
>
>
>
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org<mailto:R-sig-Geo@r-project.org>
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
>         [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to