library("stringr")
#use this to get and set file directory
#getwd()
#setwd("/Users/....")
#Create variables for what you want changed into next text
#be sure to put text in parenthesis
#be sure that the new word isn't the same as a word that you already have in some files if you want to be able to keep them seperate later
old_name_1 <- "4"
new_name_1 <- "four"
old_name_2 <- "3"
new_name_2 <- "three"
#Change wrong nubers to correct words
file.rename(list.files(pattern = old_name_1), str_replace(list.files(pattern = old_name_1),pattern = old_name_1, new_name_1))
## logical(0)
file.rename(list.files(pattern = old_name_2), str_replace(list.files(pattern = old_name_2),pattern = old_name_2, new_name_2))
## logical(0)