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

spread crashing for a data_frame with 2 columns (but not for a data.frame) #48

Closed
joshualande opened this issue Dec 17, 2014 · 2 comments

Comments

@joshualande
Copy link

I am on the latest version of everything using RStudio: "Check for Updates -> All packages are up to date."

Spread works when using a data.frame:

> df <- data.frame(x = c("a", "b"), y = c(3, 4))
> df
  x y
1 a 3
2 b 4
> df %>% spread(x, y) 
   a  b
1  3 NA
2 NA  4

But with a data_frame, the same commands error out:

> df <- data_frame(x = c("a", "b"), y = c(3, 4))
> 
> 
> df
Source: local data frame [2 x 2]
  x y
1 a 3
2 b 4
> df %>% spread(x, y) 
Error in .subset2(x, i, exact = exact) : subscript out of bounds

Does that make sense?

Thanks!

Joshua

@hadley
Copy link
Member

hadley commented Dec 17, 2014

Should be fixed in dev version of dplyr

@hadley hadley closed this as completed Dec 17, 2014
@joshualande
Copy link
Author

Awesome, thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants