-
Notifications
You must be signed in to change notification settings - Fork 2k
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
facet_grid drops duplicate cases #443
Comments
I found the guilty line, in facet-locate.r, line 17: # Workaround for bug in reshape
data <- unique(data) I commented out this line and it appears to generate the correct result image. However, it fails one of the tests: Facetting (location): margins add extra data. Here's the relevant test code, using the original (uncommented) version of df <- expand.grid(a = 1:2, b = 1:2)
panel <- layout_grid(list(df), "a", "b", margins = "b")
loc <- locate_grid(df, panel, "a", "b", margins = "b")
panel
# PANEL ROW COL a b
# 1 1 1 1 1 1
# 2 2 1 2 1 2
# 3 3 1 3 1 (all)
# 4 4 2 1 2 1
# 5 5 2 2 2 2
# 6 6 2 3 2 (all)
loc
# a b PANEL
# 1 1 1 1
# 2 1 2 2
# 3 1 (all) 3
# 4 2 1 4
# 5 2 2 5
# 6 2 (all) 6
expect_that(nrow(loc), equals(nrow(df) + 2))
# This works With the modified (commented) version, there are a couple extra lines in loc
# a b PANEL
# 1 1 1 1
# 2 1 2 2
# 3 1 (all) 3
# 4 1 (all) 3
# 5 2 1 4
# 6 2 2 5
# 7 2 (all) 6
# 8 2 (all) 6
expect_that(nrow(loc), equals(nrow(df) + 2))
# Fails @hadley what is the meaning of |
I think the test is wrong.
Or in general, for
|
@BrianDiggs that makes sense. I don't think that the I wonder - what is the bug in reshape2 that is worked around by that line of code? |
The I don't know what the bug is/was that was being worked around. It was introduced in 9fb2a97 by Hadley. There was later discussion of this bug on that commit. |
Hmmm, I think I must have fixed the bug because the output without unique looks fine. I'll fix the test. |
This bug fix warrants a mention in the NEWS file. |
This is from the discussion thread here: http://groups.google.com/group/ggplot2/browse_thread/thread/5213ac35da6b36d4/bdbb8be0a658bfe5
The text was updated successfully, but these errors were encountered: