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)