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

dplyr GPF case #1798

Closed
smckinney2718 opened this issue May 4, 2016 · 2 comments
Closed

dplyr GPF case #1798

smckinney2718 opened this issue May 4, 2016 · 2 comments

Comments

@smckinney2718
Copy link

smckinney2718 commented May 4, 2016

foo <- data.frame(a = letters[c(1,2)])
bar <- tbl_df(foo)
unlist(distinct(bar[, "a"][bar[, "a"]!=""]))
@hadley
Copy link
Member

hadley commented May 26, 2016

Looks like this is actually a tibble issue.

@hadley hadley closed this as completed May 26, 2016
@krlmlr
Copy link
Member

krlmlr commented May 26, 2016

@smckinney2718: Note that bar["a"] and bar[, "a"] still return a data frame, use bar[["a"]] to return an atomic vector.

Corrupt data frames may come from elsewhere. It would be good if all verbs checked consistency of the input:

  • Do all columns have the same length?
  • Is the row.names attribute consistent?

I remember seeing something along these lines in the code, but I'm not sure. At the very least the check doesn't seem to be active for distinct().

@lock lock bot locked as resolved and limited conversation to collaborators Jun 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants