Geospatial Modelling Environment

uniquevalues (Unique Values)

Reports the unique values for a specified field in an attribute table


This command generates a sorted list of unique values for a specified field in an attribute table. If the optional parameter 'rformat' is set to TRUE then the list is reported using R syntax so that the result can be copied and pasted into R, thereby creating a vector in R that contains the unique values. If the optional variablename parameter is specified, a GME variable is also created containing the unique values (this is useful for scripting and automation in GME).


uniquevalues(in, field, [rformat], [where], [variablename]);

inthe input vector feature source
fieldthe field name to process
[rformat](TRUE/FALSE) writes the output as in R vector format (default=FALSE)
[where]the selection statement that will be applied to the feature data source to identify a subset of features to process (see full Help documentation for further details)
[variablename]if specified, a GME variable containing the unique values is created


uniquevalues(in="C:\data\roads.shp", field="ROADNAME");

uniquevalues(in="C:\data\countries.shp", field="COUNTRYNAME", variablename="countries");

uniquevalues(in="C:\data\telemetry.shp", field="ANIMALID", rformat=TRUE);


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