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

Behaviour of arranging within groups has changed #1721

Closed
khakieconomics opened this issue Mar 16, 2016 · 1 comment
Closed

Behaviour of arranging within groups has changed #1721

khakieconomics opened this issue Mar 16, 2016 · 1 comment

Comments

@khakieconomics
Copy link

Hi,

Having some issues arranging within groups with the dev version. I get that the output may have changed for principled reasons, but I'd just like to know if it's intentional before going off and doing a lot of refactoring. Please see example below.

# Using old version
install.packages("dplyr", lib = "~/Downloads/dplyr_0.4.2.tar.gz")

library(dplyr)

# Create some data
version_1 <- data_frame(a = c("a", "a", "b", "b"), b = c(4,2,3,1)) %>% group_by(a) %>% arrange(b)

# What does it look like? 
version_1


####
# Restart R Session
####

# Get latest dplyr
library(devtools)
install_github("hadley/dplyr")
library(dplyr)

# Create the same data as above
version_2 <- data_frame(a = c("a", "a", "b", "b"), b = c(4,2,3,1)) %>% group_by(a) %>% arrange(b)

# Look at the new version. The ordering has changed so that now the output doesn't respect groups
version_2

# They _are_ the same
all.equal(version_1, version_2)

# But when I convert them to data.frames they're not. Unfortunately we do this quite a bit. 
all.equal(version_1 %>% as.data.frame, version_2%>% as.data.frame)

@hadley
Copy link
Member

hadley commented Mar 16, 2016

Yes, this is by design.

@hadley hadley closed this as completed Mar 16, 2016
@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

2 participants