I am using an algorithm, which produces a dataframe, that can be saved as a csv file. I would like to change every instance of let's say the digit 2 to 5 and 3,6 and 9 to 4, meaning 22735 should become 55745, anywhere in the dataframe. If I try to use the find-replace function for the csv-file (after exporting) in an editor, unfortunately the order of the entries is changed as well. [For the csv-file to work, the first coloumn needs to count from 1 forward by 1, stating the row number within the dataframe. If I change all the values now, the file is unusable. Since I have a lot of rows, I need to replace all entries at once, and cannot check every single one ]
Therefore I do believe I need to change the values within R before exporting the dataframe.
So is there a "Find-Replace" function which looks at the entire dataframe?