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

separate() puts new columns in wrong place #394

Closed
hadley opened this issue Jan 7, 2018 · 0 comments
Closed

separate() puts new columns in wrong place #394

hadley opened this issue Jan 7, 2018 · 0 comments

Comments

@hadley
Copy link
Member

@hadley hadley commented Jan 7, 2018

library(tidyr)

df <- tibble::tibble(x = letters, y = paste0(letters, "-", 1), z1 = 1:26, z2 = 26:1)[1:4, ]
df %>% separate(y, c("y1", "y2"), "-")
#> # A tibble: 4 x 5
#>   x        z1 y1    y2       z2
#>   <chr> <int> <chr> <chr> <int>
#> 1 a         1 a     1        26
#> 2 b         2 b     1        25
#> 3 c         3 c     1        24
#> 4 d         4 d     1        23

Looks like an off by one error?

@hadley hadley closed this in a4dc592 Jan 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant