- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
library(tidyverse)
iris <- iris
means <- iris %>%
group_by(Species) %>%
summarise_all(funs(mean))
sd <- iris %>%
group_by(Species) %>%
summarise_all(funs(sd))
bottom <- means[ ,2:5] - sd[ ,2:5]
bottom$Species <- c("setosa", "versicolor", "virginica")
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 <- means[ ,2:5] + sd[ ,2:5]
top$Species <- c("setosa", "versicolor", "virginica")
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 %>%
group_by(Species) %>%
filter_if(is.numeric, all_vars(. < mean(.) + sd(.) & . > mean(.) - sd(.)))
# A tibble: 54 x 5
# Groups: Species [3]
# Sepal.Length Sepal.Width Petal.Length Petal.Width Species
# <dbl> <dbl> <dbl> <dbl> <fctr>
# 1 5.1 3.5 1.4 0.2 setosa
# 2 4.7 3.2 1.3 0.2 setosa
# 3 5.0 3.6 1.4 0.2 setosa
# 4 5.0 3.4 1.5 0.2 setosa
# 5 4.8 3.4 1.6 0.2 setosa
# 6 5.1 3.5 1.4 0.3 setosa
# 7 5.1 3.8 1.5 0.3 setosa
# 8 5.2 3.5 1.5 0.2 setosa
# 9 5.2 3.4 1.4 0.2 setosa
#10 4.7 3.2 1.6 0.2 setosa
# ... with 44 more rows
between
:
iris %>%
group_by(Species) %>%
filter_if(is.numeric, all_vars(between(., mean(.) - sd(.), mean(.) + sd(.))))
关于r - 条件非对等连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46480349/
我希望我的 C/C++ 客户端通过 SSL 验证服务器。我首先使用 从服务器下载了证书文件 openssl s_client -showcerts -connect www.openssl.org:4
我正在尝试学习使用 RSelenium。我坚持只是尝试使用 rsDriver 启动服务器。我只是想运行下面的代码并得到以下错误: rD = 8 x64 (build 9200) Matrix prod
我已经建立了一个 8 组织的单 channel 结构网络。我能够进行整个网络设置。但是设置成功后。一些 docker 实例停止监听它们各自的端口。当我做 docker ps -a它显示了一些对等节点图
如何在多个 Azure Kubernetes 集群上的 Pod 之间配置路由? 与 Google Cloud 上的 ip-alias/vpc-native 类似的内容 最佳答案 在 AKS 中,我认为
我正在尝试实现点对点连接应用程序。所以我想将 2 个以上的设备相互连接。如何为每对设备创建单独的 session 使用新的 GameKit 框架是否可以连接到 1 个以上的设备? 最佳答案 您可以使用
我一直致力于创建一个 VPC 对等连接,该连接可以使用 cloudformation 从 eu-west-1 与 us-east-1 进行对等。这是目前的云信息: AWSTemplateFormatV
我正在尝试在两个不同区域之间进行 vpc 对等互连。在这里我已经创建了资源,现在我只想将它们的 id 作为参数传递。在同一区域,我可以在两个 VPC 之间进行对等。但我在两个不同的区域收到错误,因为r
我是一名优秀的程序员,十分优秀!