Function to find the number and percentages of categories
representCategoricalData(data, variable, nrcode = NA)
a data frame
the column name
non response code
number and percentages or -1 if failure
# NOT RUN { representCategoricalData(data.frame(mark=c(0,11,78,160),gender=c("f","m","f","m")),"gender",NA) # }
Run the code above in your browser using DataLab