【发布时间】:2012-10-22 18:34:21
【问题描述】:
这可能是一个潜在的错误,我在使用独立示例重现它时遇到了困难,但是,错误消息可能有助于深入了解它。 miv 是data.table:
> str(miv)
Classes ‘data.table’ and 'data.frame': 113534 obs. of 21 variables:
$ ym : num 1980 1980 1980 1980 1980 ...
$ dte : Date, format: "1980-03-31" "1980-03-31" ...
$ xs_ret : num -16.3 -16.3 -16.3 14.3 14.3 ...
$ xs_mkt : num -8.85 -8.85 -8.85 12.77 12.77 ...
$ smb : num -7.23 -7.23 -7.23 3.62 3.62 ...
$ hml : num 0.966 0.966 0.966 0.318 0.318 ...
$ umd : num 3.713 3.713 3.713 -0.762 -0.762 ...
$ wficn : num 100567 101394 102565 100010 100019 ...
$ iv_w : num [1:113534, 1] -1.039 -0.571 -0.831 -0.357 -0.263 ...
> miv <- na.omit(miv)
Error in `[.data.table`(object, !omit) :
i is invalid type (matrix). Perhaps in future a 2 column matrix could return a list of elements of DT (in the spirit of A[B] in FAQ 2.14). Please let datatable-help know if you'd like this, or add your comments to FR #1611.
【问题讨论】:
-
您能否至少展示一下您是如何创建
iv_w列的? -
不幸的是,创建该列的代码大约有 100 行
标签: r data.table na