as discussed in inline comments to #3166
now when shift accepts negative integers we can get column names like V1_lag_-1 / V1_lead_-1, they look awkward.
Test 1963.8 didn't produce the correct error :
Expected: should be one of "lag"
Observed: 'arg' should be one of “lag”, “lead”
those are environments striped out from many R stuff that is by default active, like methods package.
test(1963.8, shift(DT$x, type = 'some_other_type'),
error = 'should be one of "lag"')
as discussed in inline comments to #3166
now when
shiftaccepts negative integers we can get column names likeV1_lag_-1/V1_lead_-1, they look awkward.My suggestion is to use
V1_shift_1/V1_shift_-1instead. This cannot be made without breaking change to current behavior, unless we introduce new type, justtype="shift". Not much changes to code, and users who prefer to use only new interface (positive to lag, negative for lead) could switch totype="shift". Good to have it for 1.12.0 as we are releasing negative n feature there.Additionally on docker tests we are getting - fixed in 76d4a62 - issue was that
match.argwas using shell dependent quotingthose are environments striped out from many R stuff that is by default active, like methods package.