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

Misleading error when using pad on grouped df #38

Closed
danielsjf opened this issue Jul 13, 2017 · 1 comment
Closed

Misleading error when using pad on grouped df #38

danielsjf opened this issue Jul 13, 2017 · 1 comment

Comments

@danielsjf
Copy link

When the date column is grouped, pad returns a misleading error.

# This works
data.frame(a = ISOdate(2017,7,13,c(1:5,4,15)), b = c(1,1,1,1,2,2,2), y =1:7) %>% 
    padr::pad()
# This returns "Error: Column `a` must have a unique name"
data.frame(a = ISOdate(2017,7,13,c(1:5,4,15)), b = c(1,1,1,1,2,2,2), y =1:7)%>%
    group_by(a,b) %>% 
    padr::pad()

When one of the columns is grouped, it could instead return something like:
"Column a exists but is grouped. Ungroup this column before using pad."

@EdwinTh
Copy link
Owner

EdwinTh commented Jul 15, 2017

I agree with you there should be a more informative error there. However I would prefer to make explicit that the grouping cannot be on the datetime variable. Will implement in at the next release. Thanks for bringing it to my attention.

EdwinTh added a commit that referenced this issue Jul 15, 2017
@EdwinTh EdwinTh closed this as completed Jul 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants