Re: [R] Code that works when run as straight code, but that fails when run as a function

2019-08-23 Thread Rui Barradas
Hello, Inline. Às 20:45 de 23/08/19, Sorkin, John escreveu: I have code that works perfectly when run as in-line code, but that fails when the code is put into a function with the following message: Error in contest1D.lmerModLmerTest(model, ll, rhs = rhs, ddf = ddf, confint = confint, : lengt

Re: [R] Code that works when run as straight code, but that fails when run as a function

2019-08-23 Thread Sarah Goslee
Since this isn't reproducible, my first guess would be that alldata, which is required for your model, is not visible within the environment of the function. Or something similar: that kind of problem is almost always a scoping issue. Sarah On Fri, Aug 23, 2019 at 3:46 PM Sorkin, John wrote: >

[R] Code that works when run as straight code, but that fails when run as a function

2019-08-23 Thread Sorkin, John
I have code that works perfectly when run as in-line code, but that fails when the code is put into a function with the following message: Error in contest1D.lmerModLmerTest(model, ll, rhs = rhs, ddf = ddf, confint = confint, : length(L) == length(model@beta) is not TRUE Why does moving the code