Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

implement lead and lag column functions #88

Merged
merged 1 commit into from
Jul 2, 2020

Conversation

amorphous1
Copy link

I had a go at implementing lead and lag as suggested in PR #85. I did not include parameter "default" from the dplyr reference, because I was not sure how to do that sensibly within the static type system. (The various "is StringCol" / "is DoubleCol" etc. checks feel somewhat duplicated, I wonder if the base class DataCol could somehow have a reference to the values array?)

@holgerbrandl holgerbrandl merged commit 32854f6 into holgerbrandl:master Jul 2, 2020
@holgerbrandl
Copy link
Owner

Thanks, I added a default argument.

I've also reimplemented pctChange to use lag (which looks really pretty now). Though, pctChange still needs a fill_method parameter to enable NA handling. I've slighted adjusted the test definition to be more precise here.

Indeed, the column type dependent handling in many krangl methods is tedious, but I think there is no real way around it. Feel felcome if you have an idea how to do.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants