Function to represent categorical data in the form - numbers (percentage)
representCategoricalDataText(data, variable, nrcode)
data frame
column name
non response code
the numbers (percentage) , -1 for failure
# NOT RUN { representCategoricalDataText(data.frame(mark=c(0,11,78,160),gender=c("f","m","f","m")),"gender",NA) # }
Run the code above in your browser using DataCamp Workspace