x 大于或等于给定数字的概率

The probability that x is larger than or equal to a given number

我正在处理以下数据:

x <- c(3.6, 3.7, 2.9, 2.5, 3.6, 1.2, 3.6)

我的任务是计算 P(x≥2.5),但我似乎找不到正确的代码来计算它。我发现的其他示例并没有给我正确的解决方案。有什么指点吗?

提前致谢。

如果要从 x 中抽取一个随机值 y,则 P(y >= 2.5) = sum(x >= 2.5)/length(x)