You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose that lag(2) could be a shorthand of x -> lag(x, 2), using Base.Fix2.
This definition should not introduce any ambiguities and would provide a convenient way for defining a function with lag different than 1.
The same for lead.
The text was updated successfully, but these errors were encountered:
I see how this would be useful (esp. for the high-level data manipulation syntax of DataFrames & co.). One issue is that for the shifts argument ShiftedArrays accepts also Tuples (actually arbitrary iterables, but that might be disallowed).
Would it be worrying that lag([1, 2]) means "shift [1, 2] by 1, whereas lag((1, 2)) is an anonymous function to shift matrices?
ShiftedArrays.lag((1,2)) currently errors, so I understand you are worried that people would mix-up vectors and tuples.
Indeed it might happen, but at least on my side I try to work hard to explain people that these types are not interchangeable in general and have different usages.
I propose that
lag(2)
could be a shorthand ofx -> lag(x, 2)
, usingBase.Fix2
.This definition should not introduce any ambiguities and would provide a convenient way for defining a function with lag different than 1.
The same for
lead
.The text was updated successfully, but these errors were encountered: