db.create {RGeostats}R Documentation

Create a standard Data Base

Description

Create a standard db-class and define its type (Grid or Point)

Usage

db.create(..., flag.grid = FALSE, nx = NA, x0 = NA, dx = NA,
nech = NA, angles=NA, ndim = NA, nvar = NA, autoname = TRUE)

Arguments

...

Set of vectors to be added to the db-class after its creation.

flag.grid

if TRUE, the db-class is a Grid. The user must then define the parameters necessary for its complete definition along all axes. If FALSE, the db-class is a set of Points. The user must provide the explicitely the number of samples which must match the size of any vector.

Note that this flag is set to TRUE automatically as soon as the argument 'nx' is defined.

nx

A vector of the number of grid meshes. The number of items in this argument gives the dimension of the space.

x0

A vector defining the origin of the grid (lower left corner). If absent, the defaulted origin corresponds to the point with all coordinates equal to 0.

dx

A vector defining the mesh of the grid. If absent, the defaulted mesh corresponds to a vector with all components equal to 1.

nech

Number of samples. In the case of a Grid, this parameter is calculated automatically as the number of grid nodes.

angles

Array giving the rotation angles (only for dimension 2 or 3). The first angle corresponds to the rotation around OZ axis, the second to a rotation around OY'and the third one around Ox". The dimension of this array cannot exceed the space dimension.

ndim

Space dimension. In the case of Grid, this parameter is calculated as the length of the vectors defining the origin, the mesh and the number of meshes.

nvar

Number of variables.

autoname

When set to TRUE, the locators are defined from the names of the variables. Otherwise, the first 'ndim' variables are considered as coordinates (locator 'x'), the 'nvar' next variables are considered as target variable (locator 'z').

Details

The '...' argument may consist in a series of variables, possibly with names.

If the Db corresponds to a Grid, samples are ordered as described in the 'Details' section of db-class.

Value

The new db-class.

See Also

db-class

Examples

# Creating a Db for a set of isolated points in 2-D
db1 <- db.create(x1=c(1,2,3),x2=c(2,3,4),z1=c(10,20,30))
db1

# Creating a Db from a list for a set of isolated points in 1-D
db2 <- db.create(list(x1=seq(0,10)))
db2

# Creating a Db organized as a 3-D grid 
db3 <- db.create(flag.grid=TRUE,x0=c(0,0,0),dx=c(1,1,0.5),nx=c(12,15,21))
db3

# Clean up
rm(db1,db2,db3)

[Package RGeostats version 14.0.10 Index]