Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
381 views
in Technique[技术] by (71.8m points)

dataframe - How to Create a two-way table, called ‘height_table’ of heights based on variables ‘Gender’ and ‘University’ in R?

So I want to create a two-way table, called ‘height_table’ of heights based on variables ‘Gender’ and ‘University’ in R? The table should contain the total for each row and column of the table.

    Height Shoesize Gender University
1     155       34 female     Sussex
2     156       36 female     Sussex
3     158       34 female     Sussex
4     178       43   male     Sussex
5     160       38 female      Essex
6     166       42   male      Essex
7     168       44   male     Sussex
8     173       43   male      Essex
9     274       45 female     Sussex
10    162       38 female      Essex
11    175       43   male      Essex
12    162       37 female     Sussex
13    163       33 female      Essex
14    164        0 female     Sussex
15    176       42   male     Sussex
16    165       39 female      Essex
17    166       38 female     Sussex

Please help


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...