Creating a table for frequency analysis results in R
问题 I need create the table a certain type(template) Mydata df=structure(list(group = c(1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 1L), degree = structure(c(1L, 1L, 1L, 1L, 1L, 3L, 2L, 1L, 1L, 1L), .Label = c("Mild severity", "Moderate severity", "Severe severity" ), class = "factor")), .Names = c("group", "degree"), class = "data.frame", row.names = c(NA, -10L)) i conduct crosstab table(df$degree,df$group) 1 2 3 Mild severity 3 3 2 Moderate severity 0 0 1 Severe severity 0 0 1 but i need the results in