- 博客(2)
- 收藏
- 关注
原创 2021-03-09
R语言 mean()函数里的trim mean(x, trim = 0.1) 就是先把x的最大的10%的数和最小的10%的数去掉,然后剩下的数算平均。 举例: a <- c(33,16,18,21,10,30,28) mean(a) [1] 22.28571 mean(a, trim = 0.2) [1] 22.6 这里的例子有7个数,那么要去掉的是7 * 0.2 = 1.4然后取整为1 个数(最大和最小各1),则去掉33和10然后算平均数 由下方计算可以得到验证。注意这里一定是取整而不是四舍五入,
2021-03-09 14:04:36
127
原创 R语言-datacamp笔记-introduction to R-3 factor
R语言-datacamp笔记-introduction to R-3 factor datacamp-introduction to R-3 factor因子 What’s a factor and why would you use it? (1) R将变量分为连续变量和分类变量 分类变量:性别是一个典型例子 `# Assign to the variable theory what this chapter is about! theory <- "factors"` What’s
2021-03-01 17:28:55
323
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人