r - Converting a data.frame into a table -
i have data.frame , want change table. has 3 columns: number, study, classes , year. i've slitting different classes (nursery, grammar school, college), producing 9 different dataframes each bellowing different class. in end i've excluded class column maintaining number, study , year. after i've converting each of dataframes, classified classes, table, using:
gt <- xtabs(g$number ~ g$study + g$year, g)
however, equation continues bring class former information, 1 i've cut down. i've no clue going wrong.
are dropped coloumn "class"? try this:
grammar <- subset(data, data$class=="grammar", select=c("number", "study", "year") gt <- xtabs(number ~ study + year, grammar)
Comments
Post a Comment