library(tidyverse)
iris
means %
group_by(Species) %>%
summarise_all(funs(mean))
sd %
group_by(Species) %>%
summarise_all(funs(sd))
bottom
bottom$Species
print(bottom)
Sepal.Length Sepal.Width Petal.Length Petal.Width Species
1 4.653510 3.048936 1.288336 0.1406144 setosa
2 5.419829 2.456202 3.790089 1.1282473 versicolor
3 5.952120 2.651503 5.000105 1.7513499 virginica
top
top$Species
print(top)
Sepal.Length Sepal.Width Petal.Length Petal.Width Species
1 5.358490 3.807064 1.635664 0.3513856 setosa
2 6.452171 3.083798 4.729911 1.5237527 versicolor
3 7.223880 3.296497 6.103895 2.3006501 virginica
如何获取Iris的行,其中Sepal.Length,Sepal.Width,Petal.Length和Petal.Width的值都落在顶部和底部数据框中的值之间?
例如,我只想要setal行,其中Sepal.Length> 4.65&Sepal.Length <5.35和Sepal.Width在3.04和3.80之间等 . 理想情况下,最终结果只包含4个数字列和种类列 .
谢谢 .