Dear #rstats community, I have a problem. I have a df with multiple char columns which I want to coerce to factors and a list of pre-defined factor level orders (vectors) that I want to apply in the process. Now apparently this isn't a wide-spread thing to do. I am using #tidyverse code.
My approach of
df <- df |> mutate(across(all_of(charvars), ~factor(., levels= levellist[[which(factors==cur_column())]]))
throws me an error telling me it "cant compute the first column ("who")" followed by "internal error"...backtrace attached. My problem is: I used the same approach literally 3 lines above on different subsets before and it works!