[STATSGRASS] R - problem with mapsets

marta.benito at uam.es marta.benito at uam.es
Thu Jul 29 09:41:03 EDT 2004


Hello, thanks Roger, following the same example:

>grass5 ms1
>R
>(help(package=GRASS))
Package: GRASS
Version: 0.2-13
Date: 2003/09/25
>print(G) 
$LOCATION
[1] "rtest"
$MAPSET
[1] "ms1"
$proj
[1] "UTM, zone: 30"
$n
[1] 1
$s
[1] 0
$w
[1] 0
$e
[1] 1
$nsres
[1] 1
$ewres
[1] 1
$Nrow
[1] 1
$Ncol
[1] 1
$Ncells
[1] 1
$xlims
[1] 0 1
$ylims
[1] 0 1
$xseq
[1] 0.5
$yseq
[1] 0.5
$ryseq
[1] 0.5
attr(,"class")
[1] "grassmeta"
get.mapsets()
[1] "ms1"       "PERMANENT"
r <- rast.get(G,"r at ms2")
print(r)
$r
[1] 123
> system("g.mapsets mapset=ms2")
> refresh.mapsets()
[1] "ms1" "ms2"
> get.mapsets()
[1] "ms1" "ms2"
> r <- rast.get(G,"r at ms2")
> print(r)
$r
[1] 123



Marta


> On Wed, 28 Jul 2004 marta.benito at uam.es wrote:
> 
> > Hello, 
> > I try to work in R (using GRASS library) with two different maps with the same
> > name that are located in two different mapsets:
> > mapset1: map r
> > mapset2: map r
> > 
> > and allways I get the same map 
> > 
> > > grass5 ms1
> > > g.region w=0 s=0 e=1 n=1
> > > r.mapcalc r=123
> > > exit
> > 
> > > grass5 ms2
> > > g.region w=0 s=0 e=1 n=1
> > > r.mapcalc r=456
> > > R
> > > library(GRASS)
> > > G <-gmeta()
> > > r <- rast.get(G,"r at ms1")
> > > r
> > $r
> > [1] 456
> 
> I'll have a look, could you tell me which version of the GRASS interface 
> you are using (help(package=GRASS)), and what print(G) says? What does 
> get.mapsets() say?
> 
> Roger
> 
> > 
> > 
> >  
> > Thanks
> > 
> > Marta
> > 
> > --------------------------------------------------------------------------
> > Mensaje enviado mediante una herramienta Webmail integrada en *El Rincon*:
> > ------------->>>>>>>>     https://rincon.uam.es     <<<<<<<<--------------
> > 
> > 
> > _______________________________________________
> > statsgrass mailing list
> > statsgrass at grass.itc.it
> > http://grass.itc.it/mailman/listinfo/statsgrass
> > 
> 
> -- 
> Roger Bivand
> Economic Geography Section, Department of Economics, Norwegian School of
> Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
> Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
> e-mail: Roger.Bivand at nhh.no
> 
> 
> _______________________________________________
> statsgrass mailing list
> statsgrass at grass.itc.it
> http://grass.itc.it/mailman/listinfo/statsgrass
> 
> 


--------------------------------------------------------------------------
Mensaje enviado mediante una herramienta Webmail integrada en *El Rincon*:
------------->>>>>>>>     https://rincon.uam.es     <<<<<<<<--------------





More information about the grass-stats mailing list