db.extract {RGeoS} | R Documentation |
Extracts a vector from the db-class
db.extract(db, names, ngrep=NA, flag.compress = TRUE, flag.2d=FALSE, pos.x=1, pos.y=2, ref = NA)
db |
|
names |
List of names of the attributes which must be extracted |
ngrep |
Generic name for the attributes. If defined, it overwrites the 'names' argument |
flag.compress |
If TRUE, the function only returns the values corresponding to the active samples (not masked by the current selection). Otherwise, values are returned for all the samples. |
flag.2d |
If TRUE (and if the |
pos.x |
Gives the rank of the coordinate used on the abscissae axis. Used only if flag.2d = TRUE. |
pos.y |
Gives the rank of the coordinate used on the ordinate axis. Used only if flag.2d = TRUE |
ref |
Vector (of space dimension) which gives the indices of the reference corner point. The extracted plane contains the reference corner point. Used only if flag.2d = TRUE. |
The vector of values. Its length is equal to the total number of samples (if flag.compress=FALSE) or to the number of active samples otherwise. If the number of fields to be extracted is equal to 1, the result is a list of values, whereas it will be a data.frame when extracting more than 1 field.
data(Example_data.db) # Load the Documentation Points Db Example_data.db # Print a short contents of the Db # Extract the vectors which corresponds to variables 'z1' and 'z2' # vector <- db.extract(Example_data.db,names=c("z1","z2")) vector # Print the contents of the extracted vector # # Clean up rm(Example_data.db,vector)