Frequency distribution of a categorical variable in R
I am trying to prepare a frequency distribution table of a categorical variable in my data and I am using below code. But the output looks ok while I view it but not printing ok in report. # These lines are not needed because the data below is already # in that format # STI<-STI_IPD1%>% select(Q18_1,Q54) # STI$Q54<-as.factor(STI$Q54) STI = structure(list(Q18_1 = c(101L, 120L, 29L, 101L, 94L, 16L, 47L, 141L, 154L, 47L, 141L, 154L, 154L, 29L, 58L, 154L, 101L, 154L, 47L, 141L, 75L, 1L, 120L, 16L, 154L, 141L, 141L, 154L, 154L, 154L, 29L, 141L, 38L, 47L, 101L, 16L, 154L, 154L, 101L, 192L, 58L, 154L