combineOverlapInfo: Find and combine points located very close in x/y space

View source: R/combineOverlapInfo.R

combineOverlapInfoR Documentation

Find and combine points located very close in x/y space

Description

Search points in x,y space that are located very close and thus likely to overlap. In case of points close enough, various options for joining names (and shortening longer descriptions) are available.

Usage

combineOverlapInfo(
  dat,
  suplInfo = NULL,
  disThr = 0.01,
  addNsimil = TRUE,
  txtSepChar = ",",
  combSym = "+",
  maxOverl = 50,
  callFrom = NULL,
  debug = FALSE,
  silent = FALSE
)

Arguments

dat

(matrix) matrix or data.frame with 2 cols (used ONLY 1st & 2nd column !), used as x & y coordinates

suplInfo

(NULL or character) when points are considered overlapping the text from 'suplInfo' will be reduced to fragment before 'txtSepChar' and combined (with others from overlapping text) using 'combSym', if NULL $combInf will appear with row-numbers

disThr

(numeric) distance-thrshold for considering as similar via searchDataPairs()

addNsimil

(logical) include number of fused points

txtSepChar

(character) for use with .retain1stPart(): where to cut (& keep 1st part) text from 'suplInfo' to return in out$CombInf; only 1st element used !

combSym

(character) concatenation symbol (character, length=1) for points considered overlaying, see also 'suplInfo'

maxOverl

(integer) if NULL no limit or max limit of group/clu size (avoid condensing too many neighbour points to single cloud)

callFrom

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

debug

(logical) additional messages for debugging

silent

(logical) suppres messages

Value

matrix with fused (condensed) information for cluster of overapping points

Examples

set.seed(2013)
datT2 <- matrix(round(rnorm(200)+3,1),ncol=2,dimnames=list(paste("li",1:100,sep=""),
  letters[23:24]))
# (mimick) some short and longer names for each line
inf2 <- cbind(sh=paste(rep(letters[1:4],each=26),rep(letters,4),1:(26*4),sep=""),
 lo=paste(rep(LETTERS[1:4],each=26),rep(LETTERS,4),1:(26*4),",",rep(letters[sample.int(26)],4),
  rep(letters[sample.int(26)],4),sep=""))[1:100,] 
head(datT2,n=10)
head(combineOverlapInfo(datT2,disThr=0.03),n=10)
head(combineOverlapInfo(datT2,suplI=inf2[,2],disThr=0.03),n=10)

wrMisc documentation built on Jan. 7, 2023, 1:27 a.m.