powered by
Function to represent categorical data in the form - numbers (percentage)
represent_categorical_textdata(data, variable, nrcode)
the numbers (percentage) , error for failure
data frame
column name
non response code
df <- data.frame(c(11, 78), c("m", "f"), stringsAsFactors = FALSE) colnames(df) <- c("mark", "gender") represent_categorical_textdata(df, "gender", NA)
Run the code above in your browser using DataLab