Displaying 1 result from an estimated 1 matches for "dzdy".
Did you mean:
drdy
2011 Dec 01
1
Raster manipulation in R
...lgorithm using R. I have some MatLab
experience doing these, and as an example to explain more or less what I
want, I have a m code to calculate the slope from a Digital elevation model:
slope=zeros(row,col);
for i=2:row-1
for j=2:col-1
dzdx=(raster(i,j+1)-raster(i,j-1))/(2*res);
dzdy=(raster(i+1,j)-raster(i-1,j))/(2*res);
slope(i,j)=sqrt(dzdx^2+dzdy^2);
end
end;
The question is to know how to do the similar procedure on R. All
suggestions are welcome
Thanks
All best,
Jorge
PD:I am using R on windows system 64 bits
--
View this message in context: http://r.789695...