R table()&cbind() Fuction
2015-10-31 03:38
232 查看
table() counts the different factor levels
> school.freq <- table(school)
> school.freq
school
A B C D E F G H
10 6 6 10 7 4 7 4
cbind() function takes a sequence of vector, matrix or data.frame and combine columns and rows respectively.
> cbind(school.freq)
school.freq
A 10
B 6
C 6
D 10
E 7
F 4
G 7
H 4
> library(MASS) > school <- painters$School > painters Composition Drawing Colour Expression School Da Udine 10 8 16 3 A Da Vinci 15 16 4 14 A Del Piombo 8 13 16 7 A Del Sarto 12 16 9 8 A Fr. Penni 0 15 8 0 A Guilio Romano 15 16 4 14 A Michelangelo 8 17 4 8 A Perino del Vaga 15 16 7 6 A ......Loading test data set.
> school.freq <- table(school)
> school.freq
school
A B C D E F G H
10 6 6 10 7 4 7 4
cbind() function takes a sequence of vector, matrix or data.frame and combine columns and rows respectively.
> cbind(school.freq)
school.freq
A 10
B 6
C 6
D 10
E 7
F 4
G 7
H 4
相关文章推荐
- 数据库应用-NF^2 Modell(Non First Normal Form)
- PBR Step by Step(一)立体角
- MATLAB ROBOT里的link robot fkine drivebot
- Laravel homestead 安装与使用 From Scratch
- C++ Boost在Windows和Linux下的编译安装
- sed,awk,grep学习笔记
- [CareerCup] 13.4 Depp Copy and Shallow Copy 深拷贝和浅拷贝
- 风骚裙摆--最后的内存池
- 把strassen乘法调出来了...
- apache的rewrite_module模块加载
- nginx的502错误
- Android笔记(四十七) Android中的数据存储——XML(三)SAX解析
- android logcat的原理及使用
- Magento 查询错误日志
- 8.11 Coins
- Objective-C中得MRC与ARC
- Lucas 定理。。。
- 【自我提升】——扔掉时间管理,专心致志吃螃蟹
- 重要性
- hdu 1542 Atlantis 矩形面积并