r - R 防止 Lazyeval
问题描述
我想high()
从rPref
库中使用更改变量名,例如
df <- data.frame(x = c(1,2,3), y = c(2,3,0))
psel(df, high(x) * high(y))
但是如果我事先不知道列名,我试过这个
psel(df, Reduce("*", sapply(colnames(df), high)))
这使
Error in calc_scores(object, df, frm) :
For the high preference high(X[[i]]) the expression must be numeric!
我试过force()
了,但在这里没有帮助
编辑:没关系,我意识到rPref
也有high_()
标准评估..
解决方案
推荐阅读
- spring - 当我从 Spring 1.5.21 升级到 2.1.5 时,pom.xml 中出现“未知”错误
- unity3d - Unity:如何通过拖动触摸来旋转第一人称相机?
- spring - 使用 Freemarker 比较 String 和 Spring Security 标签
- java - Java DBUnit AmbiguousTableNameException 错误抛出
- lambda - 是否可以定义存储与参数具有相同数据类型的 lambda 函数的数据类型?
- html - noob div 标签问题 - 自动调整大小和定位
- json - 枚举列表作为 json 模式中的对象属性
- matlab - 理解优化问题并在 Matlab 中求解(选择合适的求解器)
- date - Dart:解析日期时区给出 UnimplementedError
- c# - JSON 数据到动态(匿名类型)的转换