-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement dplyr's relocate #2432
Comments
Thank you for this comment. This is not supported intentionally. We provide
or (it is easier to move things AFTER some column than BEFORE it)
Of course this is not the same, as e.g. it does not check if I would leave it for external packages to define such utility functions, to keep DataFrames.jl API minimal: the design principle is that DataFrames.jl should provide building blocks that are efficient and cover most common use cases. In this case by "most common use cases" we understood moving some columns to the front or to the back of a data frame, which can be done easily. Therefore I am closing it, but please comment and I will reopen if you have a strongly different opinion. |
Have you considered creating an even more lightweight DataFramesCore.jl? I would think DataFrames.jl would be the right place for these kinds of obvious convenience methods and if someone didn't want the sugar, they could use a more bare bones DataFramesCore.jl. It would seem a little silly to create a new separate package for this kind of thing. I don't feel strongly about it, but it seems like this is a reasonable thing for DataFrames.jl to have. |
see #1764 |
Also we're currently trying to stabilize DataFrames 1.0 so we don't really have the bandwidth to design/develop/review utility methods at the moment. Designing a good Julian API takes a lot of work, so we'd rather defer this until we've completed the core. |
Makes sense. Thank you both 👍 |
I am trying to replicate dplyr Get started tutorial
There is a
relocate
function to re-order columns as needed.So say if we implement this in DataFrames.jl we would have something like this
relocate(df, :sex=>:homeworld, before = :height)
this will move all columns between :sex and :homeworld (inclusive) to the immediate left of the :height columnNot sure if this is appropriate in DataFrames or a DataFramesUtils.jl to keep DataFrames.jl lean and clean.
and the dplyr equivalent
The text was updated successfully, but these errors were encountered: