[R-sig-Geo] GRASS vector attribute table read into R

Sarah Goslee sarah.goslee at gmail.com
Tue Oct 19 22:26:43 CEST 2010


An even more straight-forward way is to use read.dbf() from the
foreign package.

Sarah

On Tue, Oct 19, 2010 at 4:24 PM, Roger Bivand <Roger.Bivand at nhh.no> wrote:
> On Mon, 18 Oct 2010, stephen sefick wrote:
>
>> I would like to just read in a vector table that is stored in the
>> GRASS dbf format into R.  Is there a way that I am over looking with
>> the spgrass6 package?  I can just go to the dbf file of the grass
>> mapset, but I was looking for a better option.  Thanks in advance.
>> kindest regards,
>
> Stephen,
>
> Do you mean read the GRASS vector, or just the DBF file? If the vector with
> its attributes, readVECT6() in spgrass6, which I think you know of.
> Otherwise, perhaps:
>
> zz <- execGRASS("db.select", parameters=list(table="newbugs"),
>  intern=TRUE)
> con <- textConnection(zz)
> zzz <- read.table(con, header=TRUE, sep="|")
> close(con)
>
> Hope this helps,
>
> Roger
>
>
>>


-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-sig-Geo mailing list