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

Spurious warning when selecting vars with c() #43

Closed
hadley opened this issue Nov 17, 2017 · 0 comments
Closed

Spurious warning when selecting vars with c() #43

hadley opened this issue Nov 17, 2017 · 0 comments

Comments

@hadley
Copy link
Member

@hadley hadley commented Nov 17, 2017

library(tidyr)

df <- tibble::tibble(x = 1, y = 2, z = 3)
df %>% gather("key", "value", c(2, 3))
#> Warning in if (!is.finite(x)) return(FALSE): the condition has length > 1
#> and only the first element will be used
#> # A tibble: 2 x 3
#>       x   key value
#>   <dbl> <chr> <dbl>
#> 1     1     y     2
#> 2     1     z     3
df %>% gather("key", "value", 2:3)
#> # A tibble: 2 x 3
#>       x   key value
#>   <dbl> <chr> <dbl>
#> 1     1     y     2
#> 2     1     z     3

From tidyverse/tidyr#374

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

1 participant