<div>Hi, </div><div><br></div><div>You can do that using the library spgrass6. </div><div>First you have to start Grass into the Mapset in which you wanna put your vector map, then start R inside Grass and call the library spgrass6, convert your data frame to a spatial points data frame:</div>

<div><br></div><div>> temp_spatial <- SpatialPointsDataFrame(coords,data) </div><div><br></div><div>Finally, move your spatial data frame to your Mapset:</div><div><br></div><div>> writeVECT6(temp_spatial,"map_name_in_grass",v.in.ogr_flags=c("o","overwrite"))</div>

<br><div class="gmail_quote">On Fri, Jun 8, 2012 at 7:44 AM, Johannes Radinger <span dir="ltr"><<a href="mailto:JRadinger@gmx.at" target="_blank">JRadinger@gmx.at</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi,<br>
<br>
I have a R data.frame containing around 60 columns, two of them are X and Y respectively. What is the recommended way to get these "points" imported into GRASS?<br>
<br>
Maybe the simplest way is to save the data.frame as csv and then use v.in.ascii in GRASS. I tried to do that and specified the columns for x and y and skipped the first line (header in the csv). The import works fine and all points are correctly imported but I miss the attribute names in the attribute table (header in the csv). Maybe I have just overseen this feature to use the header from the csv as attribute names... or is this just not possible?<br>


<br>
Or is there any other resp. better way to get points from R into GRASS? E.g. I could store them as spatial.points.data.frame in R but is there a native GRASS-format I could use for exporting/saving in R?<br>
<br>
any suggestions are welcome!<br>
<span class="HOEnZb"><font color="#888888"><br>
/Johannes<br>
--<br>
NEU: FreePhone 3-fach-Flat mit kostenlosem Smartphone!<br>
Jetzt informieren: <a href="http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a" target="_blank">http://mobile.1und1.de/?ac=OM.PW.PW003K20328T7073a</a><br>
_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>David Montoya González<br>Ing. Forestal, Universidad Nacional de Colombia<br>Laboratorio de Sistemas Complejos, UNAL Medellin<br><br>