[STATSGRASS] compare several maps - starting with the easier
stuff..
Jarek Jasiewicz
jarekj at amu.edu.pl
Fri Aug 10 04:05:36 EDT 2007
Carlos "Guâno" Grohmann wrote:
> Well, continuing with my quest of comparing multiple maps, I though I
> could do with some graphics first. So I would have a visual idea of
> how things are going.
> This is my idea: a simple XY plot, with neighborhood size (used to
> calculate surface roughness) in the X-axis and mean values on the
> Y-axis, so I'll end up with three curves, one for each method.
> The problem is that each method returns a different range of values,
> so how is there a way to scale all the values to a common range (say,
> 0-1) in R? so I don't need to use r.recode in all my maps?
>
> I found the function scale(), but it always returns a matrix, and I
> am importing the rasters in a dataframe:
>
> maps <-readRAST6(c("k3","k5","k7","k9","k11","k13","k15","k17","k19","k21","k31","k51","k101"));
> mapsdf <- as(maps, "data.frame");
> mapsdf=mapsdf[,-14]
> mapsdf=mapsdf[,-14]
> plot(c(3,5,7,9,11,13,15,17,19,21,31,51,101),mean(mapsdf), type="b")
>
> I pretty sure there is a better way to do this...
>
> cheers
>
> Carlos
>
>
in R?
plot(x=map$scale, y=map$mean, xlim=c(0,1).....) for all plots
or write the loop if there is lots of plots
I use that method to create multiple cross-sections from DEM
Jarek
More information about the grass-stats
mailing list