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
Will return NA on the first row. Oddly lag(x1, default=0) works as intended.
Doing the above code outside of the mutate function works fine (accepts default=x param):
e.g. blah$x2 <- blah$x1 - lag(blah$x1, n=1, default=0) works as intended.
Thus lag works differently inside and outside of mutate.
The text was updated successfully, but these errors were encountered:
From:
http://stackoverflow.com/questions/28038370/lag-changed-in-dplyr-0-4-1-default-parameter-not-working-inside-of-mutate
Trivial example that worked in previous dplyr versions but not 0.4.1, as the first row is left as NA rather than the default value:
Will return NA on the first row. Oddly
lag(x1, default=0)
works as intended.Doing the above code outside of the mutate function works fine (accepts default=x param):
e.g.
blah$x2 <- blah$x1 - lag(blah$x1, n=1, default=0)
works as intended.Thus lag works differently inside and outside of mutate.
The text was updated successfully, but these errors were encountered: