base::replace is for replacing values in a vector, but you are passing a dataframe.
its the wrong tool for the job...
affect_word <- affect_word %>% mutate_all(list(~ifelse(is.na(.),0,.)))
or
affect_word[is.na(affect_word )] <- 0
sidenote: package sjmisc includes a replace_na that i find more useful than the tidyverse version