The mutate_if function operates on columns where its .predicate argument, MyFunc in this case, is TRUE. We want to apply as.character to every column that is not already character but there is no function that directly returns the inverse of is.character. I made MyFunc to do that: !is.character() is TRUE whenever the vector passed to it is not a character vector. I could have written
dfList <- map(file_list, ~mutate_if(.x, is.numeric, as.character))
and that would have worked just as well if your data are limited to being either character or numeric. However, if a column is filled with TRUE/FALSE values, both is.numeric and is.character will be FALSE.