1 개요[ | ]
- R tapply()
R
CPU
2.7s
MEM
124M
4.5s
Reload
Copy
df <- read.table("https://raw.githubusercontent.com/shifteight/R/master/TRB/data/daphnia.txt", header=T)
head(df)
Growth.rate | Water | Detergent | Daphnia | |
---|---|---|---|---|
<dbl> | <chr> | <chr> | <chr> | |
1 | 2.919086 | Tyne | BrandA | Clone1 |
2 | 2.492904 | Tyne | BrandA | Clone1 |
3 | 3.021804 | Tyne | BrandA | Clone1 |
4 | 2.350874 | Tyne | BrandA | Clone2 |
5 | 3.148174 | Tyne | BrandA | Clone2 |
6 | 4.423853 | Tyne | BrandA | Clone2 |
Copy
attach(df)
tapply(Growth.rate, Detergent, mean)
- BrandA
- 3.88483213877778
- BrandB
- 4.01004411644444
- BrandC
- 3.95451226927778
- BrandD
- 3.55823108644444
2 같이 보기[ | ]
3 참고[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.