Function to check the format of a string column when the string values are given
testDataStringRestriction(data, column.name, nrcode = NA, allowed.strings)
data frame
the column name
non response code corresponding to the column
allowed strings or characters to represent meaningful entry
0, if success -1, if failure
# NOT RUN { testDataStringRestriction(data.frame("Age" = c(21,15), "sex" = c("m","f")),"sex",-999,c("f","m")) # }
Run the code above in your browser using DataLab