tidyverse / dplyr

dplyr: A grammar of data manipulation
https://dplyr.tidyverse.org/
Other
4.77k stars 2.12k forks source link

Wrong error message with a non-existent variable in Rstudio on Ubuntu #2349

Closed karldw closed 7 years ago

karldw commented 7 years ago

When I try to use group_by, distinct or any of the *_join verbs with Rstudio in Ubuntu, I get the error basic_string::_M_replace_aux, instead of the expected error message. (The other single-table verbs give their proper error messages.)

The issue occurs with the current version of Rstudio (1.0.44) and the preview release (1.0.136). It doesn't happen when I use R outside Rstudio, or when I use Rstudio on Windows. I'm using dplyr 0.5.0, R 3.3.1 and Ubuntu 16.10.

I'd be happy to contribute a test, though I'm not sure how to convince the CI servers to run their tests through Rstudio.

Examples with group_by, distinct and semi_join #### group_by ```r # Expected: mtcars %>% group_by(not_a_column) # Error in resolve_vars(new_groups, tbl_vars(.data)) : # unknown variable to group by : not_a_column # Actually got: mtcars %>% group_by(not_a_column) # Error in resolve_vars(new_groups, tbl_vars(.data)) : # basic_string::_M_replace_aux ``` #### distinct ```r # Expected: mtcars %>% distinct(not_a_column) # Error in distinct_impl(dist$data, dist$vars, dist$keep) : # unknown column 'not_a_column' # Actually got: mtcars %>% distinct(not_a_column) # Error in distinct_impl(dist$data, dist$vars, dist$keep) : # basic_string::_M_replace_aux ``` #### semi_join ```r # Expected semi_join(mtcars, mtcars, by = c(cyl = 'not_a_column')) # Error in semi_join_impl(x, y, by$x, by$y) : # 'not_a_column' column not found in rhs, cannot join # Actually got: semi_join(mtcars, mtcars, by = c(cyl = 'not_a_column')) # Error in semi_join_impl(x, y, by$x, by$y) : basic_string::_M_replace_aux ```
Edit: an example with mutate as well ```r # Expected mutate(mtcars, cyl2 = c(1,2,3)) # Error in mutate_impl(.data, dots) : # wrong result size (3), expected 32 or 1 # Actually got: mutate(mtcars, cyl2 = c(1,2,3)) # Error in mutate_impl(.data, dots) : basic_string::_M_replace_aux ```
krlmlr commented 7 years ago

This looks very much like a known regression in Rcpp; use Rcpp 0.12.7 or install a development version from GitHub or from Dirk's drat repository. Please don't forget reinstalling dplyr, too.

karldw commented 7 years ago

You're right, thanks! Sorry for raising the issue in dplyr.

krlmlr commented 7 years ago

No worries, this particular error is difficult to classify.