【发布时间】:2021-11-25 05:41:28
【问题描述】:
在下面的可重现数据中,我想知道如何从满足以下条件的一对一匹配向量rs 和hat 中找到元素的索引值: p>
rs < -1.96 OR rs > 1.96 元素对应的hat 元素是hat > max_hat 元素
这是否可以在下图中绘制(使用text())其绘制圆圈旁边的索引值?
x <- readRDS(url("https://github.com/rnorouzian/s/raw/main/cooks.rds"))
hat <- readRDS(url("https://github.com/rnorouzian/s/raw/main/hat.rds"))
rs <- readRDS(url("https://github.com/rnorouzian/s/raw/main/rstudent.rds"))$z
plot(hat, rs, cex = 0.2+3*sqrt(x), pch = 19)
max_hat <- boxplot.stats(hat, coef = 2)$stats[5]
【问题讨论】:
-
@akrun,虽然答案并不完整,但它们不适用于
res2?
标签: r dataframe plot dplyr subset