I have 54 CSVs with identical column headers. I need to do the following but have been unable to find an efficient way to do it (ideally I would do this in a single loop command):
1.) read in the CSVs into separate data.frames, with the data.frames titled the same as the CSVs they come from
2.) create a new column in each, titled "Name"
3.) in each data.frame, populate the cells of the new "Name" column with the title of that data.frame
4.) stack these data.frames into a new one
I have tried making for loops, which seem like the best way to go, without success. I'd be happy to hear other ways it could be done. Thanks a lot in advance!