linkPersonalIDBySSN: Takes Client, removes records where SSNs are invalid, then...

Description Usage Arguments Examples

View source: R/LinkPersonalIDBySSN.R

Description

Takes Client, removes records where SSNs are invalid, then links the PersonalIDs based upon matching SSNs. The Client is returned with a column called PrimaryPersonalID which should be a more unique identifier than the PersonalID alone.

Usage

1
linkPersonalIDBySSN(client, primaryPersonalIDsOnly = FALSE)

Arguments

primaryPersonalIDsOnly

Default false. Returns a dataframe of only PrimaryPersonalIDs and PersonalIDs

dataframe

path to folder contaning first CSV set.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
clientDf1 <- data.frame(PersonalID=c("ZP1U3EPU2FKAWI6K5US5LDV50KRI1LN7", 
                      "IA26X38HOTOIBHYIRV8CKR5RDS8KNGHV", 
                      "LASDU89NRABVJWW779W4JGGAN90IQ5B2"), 
                      FirstName=c("Timmy", "Fela", "Sarah"),
                      LastName=c("Tesa", "Falla", "Kerrigan"),
                      SSN=c("123456789", "123456789", "987654321"))

clientDf2 <- getPrimaryPersonalID(clientDf1)
# Remove the old PersonalID
clientDf2 <- within(clientDf2, rm(PersonalID))
colnames(clientDf2)[1] <- "PersonalID"
# Get a deduplicated Client
clientDf2 <- unique(clientDf2)

Ladvien/RHMIS documentation built on May 28, 2019, 1:30 p.m.