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

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

gradle error "Cannot convert the provided notation to a File or URI" -

python - NameError: name 'subprocess' is not defined -