Problem
When you run a calculation that uses fct_reorder in the “Create Calculation” step, you may see an error like the following.
Error in mutate(., filter = fct_reorder(vars, vars_order)) : ℹ In argument: `filter = fct_reorder(vars, vars_order)`.Caused by error in `fct_reorder()`:! `.f` must be a factor or character vector, not a function.
Cause
The error occurs because the column passed to fct_reorder (in the example above, vars) does not exist in your current data.
Solution
Specify column names that actually exist in your data as the arguments to fct_reorder.
fct_reorder(<column to reorder>, <column that determines the order>)
For example, to reorder product_name by the sales column, write it as follows.
fct_reorder(product_name, sales)
For more information on how to set the order of values, please also refer to the note below.