I'd like to create a folder of empty .txt files that correspond to values of the ID column. I plan to add details to these text files one by one over time. There are thousands of these IDs.
Here is an example:
IDs | People |
---|---|
124 | Jim |
345 | Mary |
675 | Hilary |
897 | Chris |
235 | John. |
I want the name of the text files to be 124.txt, 345.txt, 675.txt, etc and all saved in a folder that I can retrieve in R.
I tired to use the cat function cat(text, file = "myfile.txt") but I don't know how to automate the name of the files to be taken from the column values.