-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
mutate_if()
w/ single column breaks in r-devel
#2114
Comments
I cannot reproduce on R-devel, osx. That looks like a bug in R. What do you get when you run tbl_vars(df) and vapply(df, is.character, logical(1)) |
> tbl_vars(ds_1a)
[1] "id"
> vapply(ds_1a, is.character, logical(1))
id
FALSE > tbl_vars(ds_2a)
[1] "id" "name"
> vapply(ds_2a, is.character, logical(1))
id name
FALSE TRUE
This may be way off, but I'll swing away anyway. If it's not showing up on R-devel osx, could it be related to the new toolchain? I used the top link above. Maybe the Windows and Travis builds are using the new gcc toolchain, while th osx is not? I see that Travis build is using gcc 4.6.3. Tell me if there's a different build of R you'd like me to try. EDIT: I get the same error with yesterday's version of R-devel: > sessionInfo()
R Under development (unstable) (2016-09-20 r71321)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods
[7] base
other attached packages:
[1] dplyr_0.5.0
loaded via a namespace (and not attached):
[1] lazyeval_0.2.0 magrittr_1.5 R6_2.1.3 assertthat_0.1
[5] DBI_0.5-1 tools_3.4.0 tibble_1.2 Rcpp_0.12.7 |
Are you still seeing these problems? |
Sorry, it took a while to get back to a machine I could put r-dev on. Yes, the error is still the same error.
|
Given that we can't reproduce, I'm going to close. For future reference, I've included a simpler reprex below. library(dplyr, warn.conflicts = FALSE)
df <- tibble(id = 1:5)
dplyr::mutate_if(df, is.character, coalesce, "-")
#> # A tibble: 5 × 1
#> id
#> <int>
#> 1 1
#> 2 2
#> 3 3
#> 4 4
#> 5 5 |
In the recent r-devel,
mutate_if()
isn't working under some conditions when the dataset has only one column.The error is
But everything is fine with a second column:
output:
I think the problem is with the predicate. That error is identical to if coalesce is called directly (when the two arguments have different data types):
The problem is avoided on Linux & Windows with 3.3.1. But it's occurring Travis and a local Windows machine:
The text was updated successfully, but these errors were encountered: