CPRs <- c("010188-3639", "020187-1476", "040506-8664", "010290-3684", "010291-1180",
"010293-1599", "010294-1268", "010295-1360", "010296-3970", "010297-2007",
"010270-2905", "010271-0134", "010272-1403", "010273-3088", "010274-1633")
nonCPRs <- c(1:10)
mixedCPRs <- c(CPRs, nonCPRs)
#identify problem
isCPR(CPRs)
#no problem as there are no CPRs
isCPR(nonCPRs)
#no problem because not ALL values are CPRs
isCPR(mixedCPRs)
Run the code above in your browser using DataLab