db.grid.init {RGeostats} | R Documentation |

Initialize a Grid Data Base calculated from an already existing Db or a Polygon

db.grid.init(obj, nodes = NA, dcell=NA, origin=NA, extend=NA, margin=0, flag.regular=TRUE, flag.newdim=FALSE, randperc=100, flag.mask.polygon=TRUE, ...)

`obj` |
The alreay existing R object used to determine the offset of the new
Grid Db. This object must be either a |

`nodes` |
Array containing the number of cells along each axis. If not defined, the parameter 'dcell' is used instead if defined. If none of 'nodes' or 'dcell' is defined, a constant value is provided of 'nodes', equal to 10. If a constant is entered, this same value is used for each axis. |

`dcell` |
Array containing the cell extension along each axis. If not defined, the parameter 'nodes' is used instead (see 'nodes' for more information). |

`origin` |
When provided, this array overwrites the origin as calculated from the input Db |

`extend` |
When provided, this array overwrites the extension as calculated from the input Db |

`margin` |
This array provides the percentage by which the initial extension must be multiplied to calculate the margin. The margin is expressed in percentage. This may be either an array (of dimension ndim) or a constant value which will be considered for each direction. If the argument 'origin' is not provided, the minimum (along each axis) is decreased by this margin. If the argument 'extend' is not provided, the extension (along each axis) is increased by this margin multiplied by 1 (if the origin is defined) or 2 otherwise. |

`flag.regular` |
When TRUE, the output is a regular grid. When FALSE, the output is a stratified grid: the set of output 'nodes' is obtained by randomizing each node within the cell to which it belongs. The output Db can be read as a standard grid, but is also contains additional coordinate vectors corresponding to the startified points. |

`flag.newdim` |
When TRUE, the dimension of the output Db can be reduced as compared to the dimension of the input Db. This only happens if the number of grid nodes is equal to 1 for the largest indices of the space dimension. |

`randperc` |
When the flag.regular is switched OFF, this value gives the amount of randomization. If set to 100, the grid node may vary uniformely within [x0-r*dx/2; x0+r*dx/2] (where 'x' stands for the initial node coordinate, 'dx' is the grid mesh and 'r'is equal to the argument 'randperc' divided by 100. The argument 'randperc' must be positive. There is no check that 'randperc' not larger than 100 |

`flag.mask.polygon` |
When the new Grid has been defined using the Polygon entry, this Polygon can serve in order to create a Selection on the returned Grid file (set the argument 'flag.mask.polygon' to TRUE). |

`...` |
Arguments passed to the function |

The `db-class`

newly created. This Db is organized as a
Regular Grid. However, when flag.regular=FALSE, it also contain
coordinate variables (called Strate.x*) which correspond to the
coordinates of the stratified points.

[Package *RGeostats* version 11.2.8 Index]