Error in data.table data vv lapply vv functionx eval parse text = x

asrmel4r報錯截圖:

Error in `[.data.table`(data, , `:=`((vv), lapply(vv, function(x) eval(parse(text = x),  : 
  Supplied 10023 items to be assigned to 1084 items of column 'ainv'. If you wish to 'recycle' the RHS please use rep() to make this intent clear to readers of your code.
In addition: Warning message:
In `[.data.table`(data, , `:=`((vv), lapply(vv, function(x) eval(parse(text = x),  :
  3 column matrix RHS of := will be treated as one vector

問題解決

應該是vm(ID, ainv)而不是vm(ainv,ID)

> m1 = asreml(BWT ~ SEX + BYEAR, random = ~ vm(ANIMAL,ainv), residual = ~ idv(units),data = animalmodel.dat)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章