I'm a R beginner
I have a dataframe as following below
I want reshape dataframe above like this .. by "Dataframe format"
I know i can make it by 'table function' table(incomegr=edu.q$incomegr,edu.q$langgr) but this format is 'table' not 'dataframe'
ie, i want make each 'incomegr', 'Gr9', 'Gr8' as dataframe columns.
How can I make it?
我们可以用
as.data.frame.matrix(table(incomegr=edu.q$incomegr,edu.q$langgr))
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.