rOpenGov / iotables

Importing and Manipulating Symmetric Input-Output Tables
https://iotables.dataobservatory.eu
Other
20 stars 8 forks source link

Error with mutate #22

Closed antaldaniel closed 2 years ago

antaldaniel commented 2 years ago

​l​​ibrary(iotables)

library(xlsx)

library(dplyr)

###############################

nl <- netherlands_2006

input_coeff_nl <- input_coefficient_matrix_create(

data_table = netherlands_2006,

households = FALSE)

compensation_indicator <- input_indicator_create(netherlands_2006, 'compensation_employees')

I_nl <- leontief_inverse_create(input_coeff_nl)

indirect_effects_create(input_requirements = compensation_indicator,

                    inverse = I_nl)

And while computing indirect_efects_create() function R gives me an error:

Error in mutate():

! Problem while computing ..1 = across(1, gsub(pattern = "_indicator", replacement = "", x = .)).

Caused by error in across():

! .fns must be NULL, a function, a formula, or a list of functions/formulas.

Run rlang::last_error() to see where the error occurred.

Rlang package gives a bit more information about the error:

rlang::last_trace()

<error/dplyr:::mutate_error>

Error in mutate():

! Problem while computing ..1 = across(1, gsub(pattern = "_indicator", replacement = "", x = .)).

Caused by error in across():

! .fns must be NULL, a function, a formula, or a list of functions/formulas.


Backtrace:

 x
  1. +-iotables::indirect_effects_create(...)

  2. | -... %>% mutate(across(1, paste0(., "_indirect_effect")))

  3. +-dplyr::mutate(., across(1, paste0(., "_indirect_effect")))

  4. +-dplyr::mutate(...)

  5. -dplyr:::mutate.data.frame(...)

  6. -dplyr:::mutate_cols(.data, dplyr_quosures(...), caller_env = caller_env())

  7. +-base::withCallingHandlers(...)

  8. -dplyr:::expand_across(dots[[i]])

  9. -dplyr:::across_setup(...)

  1. -rlang::abort(msg, call = call(across_if_fn))
antaldaniel commented 2 years ago

Solved in 0.9.1.