有dplyr::rename
对应的plyrmr
吗?
我尝试这样做:
magic.wand(rename)
和
magic.wand(rename,mergeable=TRUE,vectorized=TRUE)
但是它不能解决我的以下代码问题:
input(mtcars) %|% bind.cols(temp=mpg/gear) %|% rename(nice=temp)
谢谢
这是我找到的解决方案:
input(mtcars) %|% bind.cols(temp=mpg/gear) %|%
gapply(function(x) {
names(x)[names(x)=="temp"] <- "nice"
return(x)
})
但是我仍然想知道为什么魔术棒在这种情况下不起作用。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句