db-class {RGeostats} | R Documentation |
A structure has been developped to capture any type of information that is passed as an input data or used as an output result.
In the case of a Grid Db, the samples are ordered such that the indices of the smallest dimension varies more quickly, followed by the second smallest dimension, and so on.
For example, in the case of a 3-D grid where NX=2, NY=3, NZ=2:
Sample #1: X=1; Y=1; Z=1
Sample #2: X=2; Y=1; Z=1
Sample #1: X=1; Y=2; Z=1
Sample #2: X=2; Y=2; Z=1
Sample #1: X=1; Y=3; Z=1
Sample #2: X=2; Y=3; Z=1
Sample #1: X=1; Y=1; Z=2
Sample #2: X=2; Y=1; Z=2
Sample #1: X=1; Y=2; Z=2
Sample #2: X=2; Y=2; Z=2
Sample #1: X=1; Y=3; Z=2
Sample #2: X=2; Y=3; Z=2
Objects can be created by calls of the form new("db", ...)
.
They mainly correspond either to a set of individual points to an organized grid. The number of space dimensions is not limited. The number of variables is not limited.
flag.grid
:Object of class "logical"
Is set to TRUE if the file contains a grid and to FALSE otherwise
ndim
:Object of class "numeric"
Space dimension
x0
:Object of class "numeric"
Vector containing the coordinates of the lower corner of the grid. These parameters are only used when the data is organized as a grid (flag.grid=TRUE).
dx
:Object of class "numeric"
Vector containing the mesh of the grid. These parameters are only used when the data is organized as a grid (flag.grid=TRUE).
nx
:Object of class "numeric"
Vector containing the
number of meshes for the grid. These parameters are only used when
the data is organized as a grid (flag.grid=TRUE).
angles
:Object of class "numeric"
The item
provides the array of rotation angles (only used in 2-D or 3-D). The
angles are sorted as follows: Rotation around OZ, then rotation around
OY then rotation around Ox”.
flag.rotation
: Object of class "numeric"
This
item says if the grid is rotated or not. This will avoid superfluous
calculations.
locators
:Object of class "character"
The locators provide a set of nicknames to each field of the data
frame. These nicknames are used for the program to default
variables to calling functions.
These nicknames must belong to the following list:
rank : rank of the sample
x* : coordinate
z* : the data variable (on which the actual calculations are processed)
v* : measurement error variance
f* : external drift
g* : gradient components
lower* : lower bounds of intervals
upper* : upper bounds of intervals
p* : proportion of a facies
w : the weighting variable
code : code variable
sel : the selection
dom : domain variable
dblk : block extension (used for estimation on Tartan grids)
adir : Faulting azimuth angle
adip : Faulting dipping angle
size : Faulting size
bu : Faulting UP termination
bd : Faulting DOWN termination
time : Time for time-to-depth conversion
layer : Layer indicator for multi-layer interpolation
nostat : varying covariance parameters for non-stationary context
tangent: tangent components
ncsimu : non-conditional simulations
facies : simulated facies
gausfac: simulated gaussian value for facies
date : date
rklow : discretization rank for lower bound in the Rule
rkup : discretization rank for upper bound in the Rule
The locators followed by '*' must be followed by a number.
items
:Object of class "data.frame"
The data
db[row,col]
returns the value to the corresponding element of the data.frame db
db[row,col]<-value
assigns value
to the corresponding element of the data.frame db
db$parameter
is used to query the value of parameter
from db
:
flag.grid : 1 for a Grid organization and 0 otherwise
ndim : Space dimension
nech : Number of samples
nsamples : Number of samples
nactive : Number of active samples (in the current selection)
nmasked : Number of masked samples (in the current selection)
natt : Number of attributes
x0 : Vector of grid origin for a Grid organization or NA otherwise
dx : Vector of grid meshes for a Grid organization or NA otherwise
nx : Vector of number of grid meshes for a Grid organization or NA otherwise
locators: Array of locators (see corresponding Slot for details)
names : Array of variable names
items : The data frame containing the numerical information
limits: Matrix containing the bounding box or NA otherwise
bbox: Matrix containing the extended bounding box (including half grid mesh) (for grids only)
extends: Matrix containing the field extension or NA otherwise
center: Matrix containing the field center or NA otherwise
<name>: Vector containing the variable <name> values
Same as above but for assignment
Other functions are available, such as:
db.add
Add variables to a db-class
db.compare
Calculate pointwise statistics
db.create
Create a new db-class
db.delete
Delete variables from a db-class
db.digit
Identify samples of a db-class
by graphic picking
db.edit
Edit the contents of a db-class
db.extract
Extract a set of variables from a db-class
db.getcols
Identify the variable column from locator and rank
db.getname
Identify the variable name from locator and rank
db.grid.init
Initialize a db-class
according to a Grid organization
db.read.format
Load the contents of a Grid file (Specific format)
db.grid.locate
For a given set of coordinates, identify the closest node of a db-class
db.indicator
Convert a continuous variable into indicators using a limits-class
db.info
Returns information on the contents of the db.class
db.locate
Define the locators in a db-class
db.write.format
Save the contents of a variable within a db-class
into a Grid File (specific format)
db.polygon
Build a selection on the db-class
using a polygon-class
db.projec
Apply a projection on the db-class
db.read
Read the contents of a db-class
from a neutral ASCII File
db.rename
Modify the names of the variables within a db-class
db.rule
Convert a continuous variable into categorical variables using a rule-class
db.selcombine
Combine the current selection with the already existing one
db.sel
Create a selection variable
db.stat
Calculate statistics for a set of variables of a db-class
db.limits
Convert a continuous variable into categorical variables using limits-class
showClass("db")