- Hands-On Data Science with R
- Vitor Bianchi Lanzetta Nataraj Dasgupta Ricardo Anjoleto Farias
- 72字
- 2021-06-10 19:12:35
Aggregation functions
If, say, we were interested in finding the aggregate values of each Region of the US, we could use aggregate to find the cumulative values on a per region basis. To find the min, max, and mean of each column aggregated by region, we will first add the region value to our DataFrame:
# aggregate state$Region <- state.region ncol(state) aggregate(state[,-c(9,10)], by=list(state$Region), mean, na.rm = T)
Following is the output:
推薦閱讀
- Hands-On Graph Analytics with Neo4j
- 軟件架構(gòu)設(shè)計(jì)
- Effective DevOps with AWS
- 精通Excel VBA
- 工業(yè)機(jī)器人入門實(shí)用教程(KUKA機(jī)器人)
- 可編程控制器技術(shù)應(yīng)用(西門子S7系列)
- Windows Server 2003系統(tǒng)安全管理
- 網(wǎng)絡(luò)管理工具實(shí)用詳解
- 網(wǎng)絡(luò)服務(wù)搭建、配置與管理大全(Linux版)
- Mastering Ceph
- 基于ARM9的小型機(jī)器人制作
- 中文版AutoCAD 2013高手速成
- MongoDB 4 Quick Start Guide
- Cortex-M3嵌入式處理器原理與應(yīng)用
- PowerPoint 2010幻燈片制作高手速成