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

all_equal always converts variable types #1484

Closed
hadley opened this issue Oct 29, 2015 · 1 comment
Closed

all_equal always converts variable types #1484

hadley opened this issue Oct 29, 2015 · 1 comment
Assignees
Labels
Milestone

Comments

@hadley
Copy link
Member

@hadley hadley commented Oct 29, 2015

df1 <- data_frame(x = "a")
df2 <- data_frame(x = factor("a"))

all_equal(df1, df2, convert = FALSE) # shouldn't be equal
all_equal(df1, df2, convert = TRUE)

@romainfrancois can you please take a look? The code looks ok on the surface, so I suspect it's some change to how DataFrameSubsetVisitors or is_compatible() works.

@hadley hadley added the bug label Oct 29, 2015
@hadley hadley added this to the 0.5 milestone Oct 29, 2015
@romainfrancois
Copy link
Member

@romainfrancois romainfrancois commented Nov 1, 2015

Now getting:

> df1 <- data_frame(x = "a")
> df2 <- data_frame(x = factor("a"))
>
> all_equal(df1, df2, convert = FALSE) # shouldn't be equal
[1] "Incompatible type for column x: x character, y factor"
> all_equal(df1, df2, convert = TRUE)
[1] TRUE
Warning message:
In equal_data_frame(target, current, ignore_col_order = ignore_col_order,  :
  coercing factor to character vector

@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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants