这可能是一个潜在的错误,我很难使用独立的示例重现它,但是,错误消息可能有助于深入挖掘它。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.