Geospatial Modelling Environment

r.writedatatofield (Write R Vector To Field)

Writes an R vector to a vector attribute table


This command will write values from an R vector to an attribute table using an integer unique ID field to relate the two sets of data. This command is designed to be used in conjunction with the r.loaddata command, and subsequent processing of that data in R using the r() command. If a new R vector results from this processing, it can be added as a new field to the attribute table of the original data source. You should ensure that the lengths of the vectors referenced by the ‘ruid’ and ‘rvector’ parameters are identical. Note that R is case sensitive.


r.writedatatofield(ruid, rvector, out, uidfield, datafield, fieldtype);

ruidthe R vector containing the integer unique ID values corresponding to the values in ‘uidfield’
rvectorthe R vector containing the data values to be written
outthe output feature data source
uidfieldthe unique ID field name (must be an integer field)
datafieldthe name of the new data field to create
fieldtypethe field data type – short integer, long integer, double precision real number, or string (options: SHORT, LONG, DOUBLE, STRING)


r.writedatatofield(ruid=”PntID”, rvector=”weight”, out=”C:datasamples.shp”, uidfield=”PntID”, datafield=”WEIGHT”, fieldtype=”DOUBLE”);

r.writedatatofield(ruid=”FID”, rvector=”label”, out=”C:datalakes.shp”, uidfield=”FID”, datafield=”MAPLABEL”, fieldtype=”STRING”);


Please consider making a purchase to support the continued development of these tools  Read more...

Tips on how to use this interface efficiently 


Open Source GIS

Copyright © 2001-2014 Hawthorne L. Beyer, Ph.D., Spatial Ecology LLC    Connect on LinkedIn