.vAsDataTable | R Documentation |
GRASS vectors can be linked to an attribute table, which can be exported from GRASS to R using this function. This function is mostly of use to developers.
Values in the cat
column are not necessarily unique–if a value appears more than once, the set of features they index are (in other software) called "multipart" features. The table can have more columns with metadata for each feature.
This function is typically used by developers.
.vAsDataTable(x)
x |
A |
A data.table
or NULL
if the vector is not attached to a database.
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
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.