mutate_at () shows an estimation error when used with group_by () and when imputing a numeric vector for a column position as the first (.vars) argument.
- The problem occurs when using
R 3.4.2 and dplyr version 0.7.4 - Works great when using
R 3.3.2 and dplyr 0.5.0 - Works well if .vars is a character vector (column name)
Example:
# Create example dataframe Id <- c('10_1', '10_2', '11_1', '11_2', '11_3', '12_1') Month <- c(2, 3, 4, 6, 7, 8) RWA <- c(0, 0, 0, 1.579, NA, 0.379) dftest = data.frame(Id, Month, RWA)
Error in mutate_impl(.data, dots) : Evaluation error: object 'NA' not found.
A more convincing example demonstrating the problem:
# Create example dataframe Id <- c('10_1', '10_2', '11_1', '11_3', '11_3', '12_1') Month <- c(2, 3, 4, 6, 7, 8) RWA <- c(0, 0, 0, 1.579, NA, 0.379) dftest = data.frame(Id, Month, RWA)