Skip to contents

Adds a constant to all category values of a GRASS vector. This function is mostly of use to developers.

Usage

.vIncrementCats(x, add)

Arguments

x

A GVector or the sources() name of one.

add

Integer: Value to add to each category value.

Value

The sources() name of a GRASS vector with category values incremented.

Examples

if (grassStarted()) {

madRivers <- fastData("madRivers")
rivers <- fast(madRivers)

.vCats(rivers)
.vHasDatabase(rivers)
.vAsDataTable(rivers)
.vRecat(rivers) # dangerous--re-categorizes geometries!
.vValidCats(rivers)

.vDetachDatabase(rivers) # dangerous--detaches database!
.vAttachDatabase(rivers)

# Ensure we don't use this for other examples!
.rm(rivers) # delete in GRASS
rm(rivers) # delete in R

}