-1

I have a data.frame and I want to change into a table. It has three columns: Number, Study, Classes and Year. I've slitting it into those different Classes (nursery, grammar school, college), producing 9 different dataframes each bellowing to a different class. In the end I've excluded the Class column maintaining just the Number, Study and Year. After that I've converting each of those dataframes, classified by classes, into a table, using:

GT <- xtabs(G$Number ~ G$Study + G$Year, G)

However, this equation continues bring the Class former information, the one I've cut down. I've no clue about what is going wrong.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
  • 1
    Hi and welcome to S.O. To get better help, I encourage you to read http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example. Also, provide more details about what you want to achieve, the code you have used so far and the error messages that you get, if any. – Jason V Mar 17 '15 at 00:19

1 Answers1

0

Are you certain that you dropped coloumn "Class"? Try this:

Grammar <- subset(data, data$class=="Grammar", select=c("Number", "Study", "Year")
GT <- xtabs(Number ~ Study + Year, Grammar)
Kvasir EnDevenir
  • 907
  • 1
  • 10
  • 25