[STATSGRASS] plot of mean slope x elevation

Roger Bivand Roger.Bivand at nhh.no
Thu Jul 26 11:02:15 EDT 2007


On Thu, 26 Jul 2007, Carlos "Guâno" Grohmann wrote:

> Does anyone know how to make a plot of mean slope x elevation like
> figures 8 and 9 of:
> Guth, P. L. , 2006. Geomorphometry from SRTM: Comparison to NED
> Photogrammetric Engineering and Remote Sensing, , 72, 269-278
>
> see figure attached

Something like this:

library(spgrass6)
sf <- readRAST6(c("elevation.dem", "slope"))
df <- as(sf, "data.frame")
df1 <- df[order(df$elevation.dem),]
df1$elev.factor <- cut(df1$elevation.dem, breaks=seq(1051, 1840, 10),
   ordered_result=TRUE)
df2 <- tapply(df1$slope, df1$elev.factor, mean, na.rm=TRUE)
str(df2)
plot(df2, seq(1051, 1840, 10), type="l")

in spearfish - the orgiginal figure doesn't say how they binned the 
elevations, but I think that they must have done that somehow.

Roger


>
> thanks
> Carlos
>
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no


More information about the grass-stats mailing list