rmacosread-data

Combine files in multiple folders into one folder on Mac or read multiple files in different folders simultaneously in R


Is there a quick way on Mac to put thousands of files from different folders into one folder or is there a way for R to read thousands of files in different working directories simultaneously?


Solution

  • Some relevant details are missing from your question (e.g. file format, whether all the subfolders are in the same main folder). However, you may wanna look over two functions:

    list.files()
    

    combined to

    lapply()
    

    When reading the files are a good place to start. Please provide more details so we can help you in a better way.