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

Somewhat cryptic error message/behavior with rbind_all #751

Closed
kevinykuo opened this issue Nov 6, 2014 · 2 comments
Closed

Somewhat cryptic error message/behavior with rbind_all #751

kevinykuo opened this issue Nov 6, 2014 · 2 comments
Assignees
Labels
Milestone

Comments

@kevinykuo
Copy link

@kevinykuo kevinykuo commented Nov 6, 2014

When pulling data from different sources sometimes I have situations like the following. Is this expected behavior and should we have more informative error messages?

df1 <- data.frame(ID = c("A", "B"), value = as.integer(c(1, 2)))
df2 <- data.frame(ID = c("C", "D"), value = c("00003", "00004"))
dfList <- list(df1, df2)
do.call(rbind, dfList) # works fine
rbind_all(dfList) # Error: not compatible with STRSXP
@hadley
Copy link
Member

@hadley hadley commented Nov 6, 2014

This is expected behaviour, although I admit the error message could be better. It's basically telling you that rbind_list() won't automatically coerce an integer into a string, because that probably represents a problem with the underlying data.

@romainfrancois romainfrancois added this to the 0.3.1 milestone Nov 6, 2014
@romainfrancois romainfrancois self-assigned this Nov 6, 2014
@romainfrancois
Copy link
Member

@romainfrancois romainfrancois commented Nov 6, 2014

The problem was with combining integers with factors, which was erroneously allowed. We now the usual error message:

Erreur : incompatible type (data index: 2, column: 'value', was collecting: integer (dplyr::Collecter_Impl<13>), incompatible with data of type: factor
De plus : Message d'avis :
In rbind_all(dfList) : Unequal factor levels: coercing to character

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

Successfully merging a pull request may close this issue.

None yet
3 participants