db.extract {RGeostats}R Documentation

Extracts a vector from the Data Base

Description

Extracts a vector from the db-class

Usage

db.extract(db, names, flag.compress = TRUE, flag.2d=FALSE, flag.log10=FALSE,
	pos.x=1, pos.y=2, ref = NA)

Arguments

db

db-class from which a vector must be extracted

names

List of names of the attributes which must be extracted. For more information see db.ident.

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 db-class is a Grid Db), only a 2-D plane of the grid is output. The definition of this plane is given by next arguments

flag.log10

If TRUE, the extracted vector is log-transformed (base 10). The negative values are turned into NA.

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.

Value

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.

See Also

db-class,

Examples

data(Z_data.db) # Load the Documentation Points Db
Z_data.db # Print a short contents of the Db

# Extract the vectors which corresponds to variables 'z1' and 'z2' #
vector <- db.extract(Z_data.db,names=c("z1","z2"))
vector # Print the contents of the extracted vector #

# Clean up
rm(Z_data.db,vector)

[Package RGeostats version 11.1.1 Index]