.vAttachDatabase()
adds a table to a GRASS vector. This table is meant to be "invisible" to most users–they should use interact with attribute tables using the GVector
slot @table
. Some functions require tables (e.g., extract()
and spatSample()
). This function is mostly of use to developers.
Arguments
- x
A
GVector
or the name of a vector in GRASS.- table
Either
NULL
(default), or adata.frame
ordata.table
, or a numeric or integer vector:If
NULL
, then a bare minimal table will be created with a column namedcat
, holding sequential integer values.If a
data.frame
ordata.table
and no column is namedcat
, one will be created with sequential integer values. If the table does have a column namedcat
, then it should have integer (not just numeric) values.If a
vector
, then these are coerced to typeinteger
and used to define thecat
column.
There should be one row/value per geometry in
x
.- replace
Logical: If
TRUE
, replace the existing database connection.- cats
Either
NULL
(default), or an integer vector: This is provided as a means to save time by passingcats
to this function if it has already been generated by a calling function.
Value
Invisibly returns the sources()
name of a vector in GRASS.