Closed adamrauh closed 1 year ago
Upon review a few years later, I think it's ok. The dimensions of some objects are weird at times, but I tried a few solutions that I thought might be more intuitive, but that broke other code in surprising ways. It doesnt look like we are doing anything risky and every step of the code seems to be doing what it should be and generating sensible objects. I'm calling it fine.
The
parse_and_prep
function could be written more efficiently. The internally definedlag
function returns the results of ansapply
call, which creates a data frame with some weird dimensions. The data frame looks normal upon inspection, but the dimensions are wrong -- I think it's creating some sort of nested list. I accidentally worked around this by converting everything to a matrix, but it needs a better solution.My proposal is to have a small chunk of code parse the formula objects a little bit so that
lag(..., 1:3)
becomes something likelag(..., 1) + lag(..., 2) + lag(..., 3)
internally, which should be a relatively easy and reasonable fix. Just filing this so I don't forget about the issue.