为什么POSIXct对象不能与plyrmr包一起工作?下面是我的代码:
filename2 <- "/user/sgerony/mtcars"
complex.function = function(x){
as.data.frame(mutate(x,date.time=as.POSIXct("2014-01-01 03:15")))
}
magic.wand(complex.function)
mtcars %|% complex.function()结果:
mpg cyl disp hp drat wt qsec vs am gear carb date.time
1 21.0 6 160.0 110 3.90 2.620 16.46 0 1 4 4 2014-01-01 03:15:00
2 21.0 6 160.0 110 3.90 2.875 17.02 0 1 4 4 2014-01-01 03:15:00
3 22.8 4 108.0 93 3.85 2.320 18.61 1 1 4 1 2014-01-01 03:15:00
4 21.4 6 258.0 110 3.08 3.215 19.44 1 0 3 1 2014-01-01 03:15:00等等。
input(mtcars) %|% complex.function()结果:
Error in mr(map = map, reduce = reduce, combine = combine, vectorized.reduce, :
hadoop streaming failed with error code 1谢谢!
发布于 2015-11-18 02:19:22
不幸的是,plyrmr不支持这种类型的cols。我在其他地方对你同样的问题的回答是不正确的,但在那里你问了8个问题,并且在这里你提供了更多的细节。我建议将正值表示为字符串作为一种变通方法,然后在与时间相关的操作中转换入和出正值。
https://stackoverflow.com/questions/33752447
复制相似问题