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

order_by() could have an error hint when confused with arrange() #3357

Closed
econandrew opened this issue Feb 13, 2018 · 6 comments
Closed

order_by() could have an error hint when confused with arrange() #3357

econandrew opened this issue Feb 13, 2018 · 6 comments
Labels
feature a feature request or enhancement funs 😆

Comments

@econandrew
Copy link

For those of us who sometimes have SQL on the brain...

> df <- df %>% order_by(value)
Error: `call` must be a function call, not a symbol
> df <- df %>% order_by(-value)
Error: Can't use matrix or array for column indexing
> df <- df %>% arrange(-value)

e.g. Did you mean to use arrange()?

@Lef-F
Copy link

Lef-F commented Feb 16, 2018

I just stumbled upon this while trying to figure out why order_by is "not working for me today"... 😆

@AmeliaMN

This comment has been minimized.

@krlmlr krlmlr added data frame feature a feature request or enhancement labels Feb 28, 2018
@baderstine

This comment has been minimized.

@hadley

This comment has been minimized.

@hadley
Copy link
Member

hadley commented Dec 11, 2019

This would be relatively simple to implement — order_by() just needs to check if call is a symbol, and if so, offer a hint about arrange().

@hadley hadley closed this as completed in 3f9b682 Dec 31, 2019
@dennet
Copy link

dennet commented Apr 27, 2020

stumbled upon this after a long break from the tidyverse. Hint about 'arrange()' in the error message would be a nice touch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement funs 😆
Projects
None yet
Development

No branches or pull requests

7 participants