db.grid.copy {RGeostats}R Documentation

Copy variables from the Grid Dbin into the Grid Dbout

Description

Copy variables from the Grid Dbin into the Grid Dbout

Usage

db.grid.copy(dbin, dbout, names =db.getname(dbin,"z",1), ind1 = NA, ind2 = NA, 
             radix = "Copy", modify.target = db.locmod())

Arguments

dbin

The db-class used to read input variables

dbout

The db-class used to store output variables

names

List of names of attributes to be copied. For more information see db.ident.

ind1

This vector is dimensionned to the dimension of the input Grid Db. It provides the index values (considered as constant) for the dimensions which are not copied

ind2

This vector is dimensionned to the dimension of the output Grid Db. The value ind2[1] indicates the rank of the dimension in the input Grid Db.

radix

Radix of the name given to the variables storing the results in the output Grid Db.

modify.target

Decides whether or not the newly created variables will have their locator defined or not. For more information, see db.locmod.

Details

Imagine that we performed db.grid.copy() from the 4-D Dbin into the 2-D Dbout, using ind1=c(3,6,8,1) and ind2=c(2,-4). Let us denote by NDbi(j) the number of grid nodes along the j-th dimension for the i-th Db. In the following formula, we assume that the sample index varies from 1 to NDb. For each variable to be copied, the sample of Dbout numbered [i,j] will correspond to the sample of Dbin numbered [3,i,8,NDbout(4)-j-1]. In the previous formula, if the grid index along one direction (say the i-th) is negative, it is set to 1. If it exceeds NDbin(i), it is set to NDbin(i).

Imagine that 'db' refers to a 2-D Db Grid File and that we want to duplicate the variable (rank=12) by inverting the row index. We simply have to type:

db <- db.grid.copy(db,db,names=12,ind2=c(1,-2))

Value

The output Grid Db where the copied variables have been added.


[Package RGeostats version 14.0.10 Index]