incons: Detect inconsistencies in 1:1 mapping

Description Usage Arguments Details Value Examples

View source: R/incons.R

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

1
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

1
2
3
4
    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)

preputils documentation built on July 1, 2020, 5:35 p.m.

Related to incons in preputils...