Skip to content
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

introduce standardize_column_order() #474

Closed
IndrajeetPatil opened this issue Nov 26, 2021 · 2 comments
Closed

introduce standardize_column_order() #474

IndrajeetPatil opened this issue Nov 26, 2021 · 2 comments
Assignees
Labels
3 investigators ❔❓ Need to look further into this issue Enhancement 💥 Implemented features can be improved or revised Feature idea 🔥 New feature or request

Comments

@IndrajeetPatil
Copy link
Member

In {parameters}, we are repeating ourselves a ton while reordering columns.

We can avoid this by introducing a function like standardize_column_order(), which would standardize column ordering.

The function signature would be similar to standardize_names():

standardize_column_order(
  data,
  style = c("easystats", "broom"),
  ...
)

This way, if someone has adopted {broom} naming conventions, they would still be able to standardize column order for their dataframe.

If you think this is a good idea, I can work on it.

@IndrajeetPatil IndrajeetPatil added Enhancement 💥 Implemented features can be improved or revised Feature idea 🔥 New feature or request labels Nov 26, 2021
@IndrajeetPatil IndrajeetPatil self-assigned this Nov 26, 2021
@IndrajeetPatil IndrajeetPatil added the 3 investigators ❔❓ Need to look further into this issue label Nov 26, 2021
@bwiernik
Copy link
Contributor

Great idea!

Also this: col_order[col_order %in% names(out)

Can be shortened to intersect(col_order, names(out))

IndrajeetPatil added a commit that referenced this issue Nov 26, 2021
- style NEWS and code
- spell check
@DominiqueMakowski
Copy link
Member

DominiqueMakowski commented Nov 28, 2021

Good idea!

I'd name it "standardize_..." If it's to be an internal function, but if we export it, then why not make it an option of an existing function in datawizard, like "data_reorder(data, style='broom')"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 investigators ❔❓ Need to look further into this issue Enhancement 💥 Implemented features can be improved or revised Feature idea 🔥 New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants