
findSimilFrom2sets
compares to vectors or matrixes and returns combined view including only all close (by findCloseMatch
).
Return matrix (predMatr) with add'l columns for index to and 'grp' (group of similar values (1-to-many)), 'nGrp' (n of grp), 'isBest' or 'nBest', 'disToMeas'
(distance/difference between pair) & 'ppmToPred' (distance in ppm).
Note: too wide 'limitComp' will result in large window and many 'good' hits will compete (and be mutually exlcuded) if selection 'bestOnly' is selected
findSimilFrom2sets(
predMatr,
measMatr,
colMeas = 1,
colPre = 1,
compareTy = "diff",
limitComp = 0.5,
bestOnly = FALSE,
silent = FALSE,
callFrom = NULL,
debug = FALSE
)
(matrix or numeric vector) dataset number 1, referred to as 'predicted', the colum speified in argument colPre
points to the data to be used
(matrix or numeric vector) dataset number 2, referred to as 'measured', the colum speified in argument colMeas
points to the data to be used
(integer) which column number of 'measMatr' to consider
(integer) which column number of 'predMatr' to consider
(character) 'diff' (difference) 'ppm' (relative difference)
(numeric) limit used by 'compareTy'
(logical) allows to filter only hits with min distance (defined by 'compareTy'), 3rd last col will be 'nBest' - otherwise 3rd last col 'isBest'
(logical) suppress messages
(character) allow easier tracking of message(s) produced
(logical) for bug-tracking: more/enhanced messages
matrix (predMatr) with add'l columns for index to and 'grp' (group of similar values (1-to-many)), 'nGrp' (n of grp), 'isBest' or 'nBest', 'disToMeas' (distance/difference between pair) & 'ppmToPred' (distance in ppm)
# NOT RUN {
aA <- c(11:17); bB <- c(12.001,13.999); cC <- c(16.2,8,9,12.5,12.6,15.9,14.1)
aZ <- matrix(c(aA,aA+20),ncol=2,dimnames=list(letters[1:length(aA)],c("aaA","aZ")))
cZ <- matrix(c(cC,cC+20),ncol=2,dimnames=list(letters[1:length(cC)],c("ccC","cZ")))
findCloseMatch(cC,aA,com="diff",lim=0.5,sor=FALSE)
findSimilFrom2sets(aA,cC)
findSimilFrom2sets(cC,aA)
findSimilFrom2sets(aA,cC,best=FALSE)
findSimilFrom2sets(aA,cC,comp="ppm",lim=5e4,deb=TRUE)
findSimilFrom2sets(aA,cC,comp="ppm",lim=9e4,bestO=FALSE)
# below: find fewer 'best matches' since search window larger (ie more good hits compete !)
findSimilFrom2sets(aA,cC,comp="ppm",lim=9e4,bestO=TRUE)
# }
Run the code above in your browser using DataLab