incons {preputils} | R Documentation |
Detect inconsistencies in 1:1 mapping
Description
In properly normalized data bases, no inconsistencies should be present. In real world data however ID mappings or data base key candidates are repeated over and over across observations, especially in mult centric studies with basic research data. incons tries to detect and flag these mapping discrepanices
Usage
incons(x, y, printproblems=FALSE)
Arguments
x , y |
vectors of equal length, holding the mapping values, sepearated by "," |
printproblems |
Should a table of found problems be printed in addition to the returned flag? |
Details
incons assumes a 1:1 mapping between provided variables, as is commonly the case for example in ID translation steps
Value
A named vector indicating whether ambiguous mapping does occur (TRUE) or mapping is clean (FALSE)
Examples
id1 = c(1,2,2,3,4)
id2 = c("a","b","c","d","d")
ambiguous <- incons(id1,id2,print=TRUE)
data.frame(id1,id2,ambiguous)
[Package preputils version 1.0.3 Index]