I am trying to import a vector layer from my GRASS database using 
readVECT6 from the spgrass6 package. I want the data from the second layer:

a <- readVECT6("inputlayer", layer=2)

However, this gives me the error:

"Available OGR Drivers:
Error in doGRASS(cmd, flags = flags, parameters = parameters) :
   Parameter <layer> does not have integer value"

Checking the code of readVECT6, I think the problem is with:

  execGRASS("v.out.ogr", flags = flags, parameters = list(input = vname, 
type = type, layer = layer, dsn = GDSN, olayer = LAYER, format = gsub(" 
", "_", driver)), ignore.stderr = ignore.stderr)

The solution is to write the import statement as:

a <- readVECT6("inputlayer", layer=as.integer(2)).

This does import the layer (a point layer in my case), but the attribute 
table (a@data) is empty. If I change in GRASS the attribute table of 
layer 2 to layer 1, the attribute table contains all the data.

I am running the R version 2.13.0, GRASS v6.4.2 on Ubuntu 11.04

Best regards,

Paulo

	[[alternative HTML version deleted]]

