我有两个数据框x
和y
。这里共享数据(.csv和.RData格式):https://drive.google.com/file/d/0B6iPCtmOAvwxR0RfYUk1bXFMZEk/edit?usp=sharing
x
包含g
列和x.1
列。 y
列g
和x.0
。
我做了以下事情:
x_dt<-data.table(x)
y_dt<-data.table(y)
setkeyv(x_dt,"g")
setkeyv(y_dt,"g")
z_dt<-merge(x_dt,y_dt,by="g",all=T)
z<-as.data.table(z_dt)
当我尝试查看z
的输出时,例如print(z)
或tail(z)
,我收到以下错误:
Error in prettyNum(.Internal(format(x, trim, digits, nsmall, width, 3L, :
dims [product 253] do not match the length of object [254]
可能是什么问题?
*编辑*
根据请求,这是sessionInfo:
R version 3.0.2 (2013-09-25)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] compiler stats graphics grDevices utils datasets methods base
other attached packages:
[1] signal_0.7-3 MASS_7.3-29 TTR_0.22-0 xts_0.9-7
[5] zoo_1.7-10 RcppRoll_0.1.0 RcppArmadillo_0.4.000.4 Rcpp_0.11.0
[9] data.table_1.8.10
loaded via a namespace (and not attached):
[1] grid_3.0.2 lattice_0.20-23 tools_3.0.2
*编辑*
我detach
ed zoo
,TTR
和xts
已加载,但我没有使用。但错误仍然存在。
答案 0 :(得分:0)
更新到1.9.2解决了这个问题。谢谢,阿伦!