My data looked like this
head(ttrigram)
word1 word2 frequency
1 enjoying_case presentations 77
2 case_presentations students 77
3 presentations_students w 77
4 students_w good 77
5 w_good luck 77
6 good_luck students 77
I was trying to replace the underscores in word1 with blanks: My code was:
library(stringr)
ttrigram$word1<- string_replace(ttrigram$word1, "_", " ")
I get this message on the console:
Error in string_replace(ttrigram$word1, "", " ") :
could not find function "string_replace"
I also tried this using mutate() and got a similar error message.
ttrigram<- mutate(ttrigram, wordedit= string_replace_all(word1, "", " "))
Error in string_replace_all(word1, "_", " ") :
could not find function "string_replace_all"
Thank you for your help.