db.distance.polygon {RGeostats}R Documentation

Calculate the distance from Db to Polygon

Description

Calculate the distance from Db to Polygon

Usage

db.distance.polygon(db, polygon, dmax = NA, scale = 0, polin = 0, 
										radix = "Distance", modify.target = db.locmod())

Arguments

db

The db-class containing the samples for which the distance to the polygon must be calculated.

polygon

The polygon-class which must be used to calculate the distance to the samples of the 'db'. Note that the polygon may contain several polysets: then the distance is the shortest to any polyset of the polygon

dmax

If defined, any distance larger than 'dmax' is set to 'dmax'. This quantity is defined in euclidean units, even if the result must be scaled further (see argument 'scale')

scale

Defines if the result must provide the distance (use scale=0) or if it must be scaled between 0 and 1.

  • scale=0 No scaling

  • scale=1 the smallest distance will be assigned a value of 0 and the largest one a value of 1

  • scale=-1 the smallest distance will be assigned a value of 1 and the largest one a value of 0

polin

Define if the distance calculation must be combined with the property of belonging to the polygon or not. Please use:

  • 0 If the initial distance must not be modified

  • >0 Patch distance value for sample located outside the polygon

  • <0 Patch distance value for sample located within the polygon

Patched values are set to different values according to abs(polin):

  • 1 : set to NA

  • 2 : set to the minimum distance

  • 3 : set to the maximum distance

Note the minimum and maximum distance are replaced respectively by 0 and 1 if scale!=0.

radix

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

modify.target

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

Value

The input 'db' where a new attribute has been added containing the results of the distance calculation.


[Package RGeostats version 14.0.10 Index]