I am attempting to correct a dataset that has multiple different names for the same variable due to differences in capitalization (ie. pepco, Pepco, PEPCO) using stringr.
So far, I have determined the different names the variables are listed under using the following code:
file.path("/Users/ryancoffey/Desktop/ElectricityDemand.txt") -> desktop.path
read_tsv(file.path(desktop.path)) -> ElectricityDemand
print(ElectricityDemand)
ElectricityDemand %>%
distinct(Subregion)
I am wondering if anyone can help explain how to combine variables that correspond to each other but have "different" names using stringr commands.
I have included a screenshot of the dataset in order to help (datafile is a .txt file so I couldn't upload it along with this post).