[R-sig-Geo] spGRASS6 issue

R.S. Bhalla rsbhalla at gmail.com
Thu Feb 7 06:39:54 CET 2013


Thanks Rodger,
That fixed it. I agree with Rainer, it is somewhat non-intuitive.
By the way, I've been using GRASS from within R to process dozens of 
images using loops, works like a charm and saved me hours if not days of 
repetitive work.
Thanks again and cheers,
Ravi
P.S. The corrected formula is:
execGRASS("r.neighbors", parameters=list(input=patmap, output=n11map, 
method="median", size=(11L)), flags=c("overwrite", "c"))


On 02/06/2013 05:52 PM, Rainer M Krug wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 06/02/13 12:55, Roger Bivand wrote:
>> On Wed, 6 Feb 2013, R.S. Bhalla wrote:
>>
>>> Dear List, I have run into trouble with the execGRASS command copied below and can't figure
>>> out what I'm doing wrong. It runs fine without the size=11 argument (takes the default value
>>> of 3). Can
>>> storage.mode(11)
>> [1] "double"
>>> is.integer(11)
>> [1] FALSE
>>> is.integer(11L)
>> [1] TRUE
>>
>> Just because it looks like an integer, it doesn't mean it is.
> Hi Roger
>
> this has bittan many users, including myself, as it is a little aux contraire to R, as here 11 is
> acepted as integer in most circumstances.
>
> Would it be possible to use a different check for integer e.g.
>
> if(as.integer(x) == x) then {x <- as.integer(x)} else {ERROR}
>
> I have the feeling that would be more in line with the treating in R of different numerical
> storage modes.
>
> Cheers,
>
> Rainer
>
>
>
>> Roger
>>
>>> someone please help. Thanks in advance, Ravi
>>>
>>> Command: execGRASS("r.neighbors", parameters=list(input=patmap, output=n11map,
>>> method="median", size=11), flags=c("overwrite", "c"))
>>>
>>> Error: Error in doGRASS(cmd, flags = flags, ..., parameters = parameters, echoCmd = echoCmd)
>>> : Parameter <size> does not have integer value
>>>
>>>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQEcBAEBAgAGBQJREkrsAAoJENvXNx4PUvmC4YYIAPJnH4dmYQZTCJewHCGwW3zD
> szbWSeWB7Yye2DxP/7ADMQUL6buR7ZAAQWpQDjps1u6o82inoRUQ0JiUHeXGB/oW
> MHMiYFlcvK6+WU6/ZIhL8uKsyUeDscyDUfuLOeyuNpsLe1Y8RvinQWtmrwefhLVZ
> 4sjDrtSXJs0YBKRdHyhtmIkCUzXfra7VvbuOA5ehb76t0Re66Dvmzha1VvgBSa1Y
> oOP/zlzj+AqK/RrJX2Jlt2YrdU97wsb80MeHlkIX7h33qKriaqf9okcURPyMkIib
> pR+qED66Fjz916qnyn8RWiI8lRSg64uYyWbgGyx2OlsyRNxfvD7dvG45ZnuqrLQ=
> =X7qL
> -----END PGP SIGNATURE-----
>

-- 
R.S. Bhalla, Ph.D.
Sr.Research Fellow
Foundation for Ecological Research, Advocacy and Learning (FERAL)
Ph. +91 413 2671566
Fax. +91 413  2671567
Web: http://www.feralindia.org



More information about the R-sig-Geo mailing list