[R-sig-Geo] spgrass6 and null values

Roger Bivand Roger.Bivand at nhh.no
Fri Mar 7 17:57:41 CET 2008


On Fri, 7 Mar 2008, Facundo Muñoz wrote:

>
> Hello list,
>
> while exporting vector maps form GRASS to R using readVECT6(spgrass6),
> null values in attributes become zeroes in R, and makes them
> undistinguishable from real zero-valued attributes.

This is a "feature" of shapefiles - the format used for the intermediate 
file. There is no known workaround, as as far as I know, there is no 
general workaround using v.out.ogr and v.in.ogr in the other direction. 
This is now noted on the readVECT6 function help page.

>
> I'm making a work-around, by previously replacing zeroes by 0.5 in GRASS
> (wich is an impossible value) and then reverting once in R.
>
> But i wonder if there is a correct way of doing this that i didn't find.
> If not, i suggest to add the feature of passing null values to NAs and
> viceversa.

I think that this lies on the v.out.ogr side - does anyone know of 
null-aware generic DB drivers on the GRASS side - the db.* SQL references 
refer to null handling, but can the nulls be exported? It would be 
unfortunate to restrict use of null-aware interface mechanisms to a 
particular driver.

Ideas?

Roger


>
> Greetings
>       Facundo Muñoz
>       Universidad de Valencia
>       Spain
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no


More information about the R-sig-Geo mailing list