[R] spgrass6 and aggregation (bis)

From: <jessica.gervais_at_tudor.lu>
Date: Wed, 06 Jun 2007 11:35:34 +0200

Dear all,

I have some additionale question concerning the spgrass6 package.

Could this be the problem ?

Thanks,

Jessica

########################################################################3

Dear all,

I am exporting grass map into R thanks to the very useful spgrass6 package.

library(spgrass6)

# I have 3 map I am working with a MASK map of a specific area.

# 1) a landuse map

landuse<-readRAST6("landuse_mapname_in_grass")

# 2) a catchment map which divide the area in several catchements
catchment<-readRAST6("catchement_mapname_in_grass")

# 3) a precipitation map

precipitation<-readRAST6("precipitation_mapname_in_grass")

# then I would like to sum the precipitation spatialy over each catchment
and landuse. So, first I cbind all maps with cbind

MAP<-cbind(landuse,catchment,precipitation)

# then I use the aggregate function
SUM<-aggregate(MAP[3],by=list(MAP[1],MAP[2]),sum,na.rm=TRUE)
# here is the problem !!!

Error in as.vector(x, mode) : invalid argument 'mode'

....

I don't find any idea to solve this...

Does anyone has a suggestion ??

Thanks in advance

Jess



R-help_at_stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed 06 Jun 2007 - 09:39:02 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 06 Jun 2007 - 11:31:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.