Bill, you are the not the one doing anything wrong. I fixed this bug
in 'raster' version 1.5-12. Thanks for reporting it, Robert
On Wed, Sep 29, 2010 at 12:17 PM, William McCoy<wdmccoy at geo.umass.edu> wrote:
I have a raster DEM loaded in R and I am using the raster package. My DEM
is called lakeside:
Loading required package: sp
raster version 1.5-8 (20-September-2010)
class : RasterLayer
filename :
nrow : 341
ncol : 321
ncell : 109461
min value : 1288.399
max value : 1704.749
projection : +proj=utm +zone=12 +ellps=WGS84 +datum=WGS84 +units=m +no_defs
+towgs84=0,0,0
xmin : 344459.7
xmax : 347669.7
ymin : 4532817
ymax : 4536227
xres : 10
yres : 10
When I use the focalFilter function with a filename argument, I get the
following error:
xslopeLS<- focalFilter(lakeside, matrix(filtHorn, nrow = 3)
+ /(8*xres(lakeside)), filename = "xslopeLS")
Error in .local(object, values) :
setValues no longer supports setting rows of values
However, if I call the same function without the filename argument, it seems
to work fine:
xslopeLS<- focalFilter(lakeside, matrix(filtHorn, nrow = 3)
class : RasterLayer
filename :
nrow : 341
ncol : 321
ncell : 109461
min value : -1.468210
max value : 1.196593
projection : +proj=utm +zone=12 +ellps=WGS84 +datum=WGS84 +units=m +no_defs
+towgs84=0,0,0
xmin : 344459.7
xmax : 347669.7
ymin : 4532817
ymax : 4536227
xres : 10
yres : 10
Here is my filter:
[1] -1 -2 -1 0 0 0 1 2 1
And here is my sessionInfo():
R version 2.11.1 (2010-05-31)
x86_64-redhat-linux-gnu
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=C LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] raster_1.5-8 sp_0.9-69
loaded via a namespace (and not attached):
[1] grid_2.11.1 lattice_0.19-11
Any idea what I'm doing wrong?
Thanks for your help,
Bill
--
William D. McCoy
Geosciences
University of Massachusetts
Amherst, MA 01003