"R aggregate()"의 두 판 사이의 차이

잔글 (Jmnote님이 R언어 aggregate() 문서를 R aggregate() 문서로 이동하면서 넘겨주기를 덮어썼습니다)
35번째 줄: 35번째 줄:


[[분류: R]]
[[분류: R]]
[[분류: R stats]]

2019년 4월 6일 (토) 11:30 판

1 개요

R aggregate()
aggregate(Sepal.Length ~ Species, data=iris, sum)
#     Species Sepal.Length
#1     setosa        250.3
#2 versicolor        296.8
#3  virginica        329.4

aggregate(Sepal.Length ~ Species, data=iris, mean)
#     Species Sepal.Length
#1     setosa        5.006
#2 versicolor        5.936
#3  virginica        6.588

aggregate(. ~ Species, data=iris, mean)
#     Species Sepal.Length Sepal.Width Petal.Length Petal.Width
#1     setosa        5.006       3.428        1.462       0.246
#2 versicolor        5.936       2.770        4.260       1.326
#3  virginica        6.588       2.974        5.552       2.026

2 같이 보기

3 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}