elimCloseCoord: Eliminate close (overlapping) points (in x & y space)

View source: R/elimCloseCoord.R

elimCloseCoordR Documentation

Eliminate close (overlapping) points (in x & y space)

Description

elimCloseCoord reduces number of rows in 'dat' by eliminating lines where x & y coordinates (columns of matrix 'dat' defined by 'useCol') are identical (overlay points) or very close. The stringency for 'close' values may be fine-tuned using nDig), this function uses internally firstOfRepeated.

Usage

elimCloseCoord(
  dat,
  useCol = 1:2,
  elimIdentOnly = FALSE,
  refine = 2,
  nDig = 3,
  callFrom = NULL,
  silent = FALSE
)

Arguments

dat

matrix (or data.frame) with main numeric input

useCol

(numeric) index for numeric columns of 'dat' to use/consider

elimIdentOnly

(logical) if TRUE, eliminate real duplicated points only (ie identical values only)

refine

(numeric) allows increasing stringency even further (higher 'refine' .. more lines considered equal)

nDig

(integer) number of significant digits used for rounding, if two 'similar' values are identical after this rounding the second will be eliminated.

callFrom

(character) allows easier tracking of message(s) produced

silent

(logical) suppress messages

Value

resultant matrix/data.frame

See Also

findCloseMatch, firstOfRepeated

Examples

da1 <- matrix(c(rep(0:4,5),0.01,1.1,2.04,3.07,4.5),nc=2); da1[,1] <- da1[,1]*99; head(da1)
elimCloseCoord(da1)

wrMisc documentation built on Nov. 17, 2023, 5:09 p.m.