【发布时间】:2017-10-31 02:52:08
【问题描述】:
我有以下数据集
> temp6
# A tibble: 120 x 1
Arithmetic Mean
<dbl>
1 0.96
2 2.09
3 0.57
4 0.66
5 0.92
6 0.60
7 0.40
8 0.42
9 0.27
10 0.47
# ... with 110 more rows
我非常需要这个数据列的中位数,但是当我尝试时很明显
median(temp6, na.rm=TRUE)
我收到此错误消息:
Error in median.default(temp6, na.rm = TRUE) : need numeric data
如果我尝试将此数据转换为“数字”,那也不起作用
as.numeric(temp6, na.rm=TRUE)
或
as.numeric(as.character(temp6)
给予:
Error: (list) object cannot be coerced to type 'double'
和
Warning message:
NAs introduced by coercion
分别。我已经做了足够的研究,知道这些过程都不起作用,但我无法找到任何解决方法来找到这些数据点的中位数。有什么办法可以做到这一点?
【问题讨论】:
-
将评论移至适当位置