Reading all scripts and data files from multiple folders

后端 未结 3 1067
小鲜肉
小鲜肉 2020-12-23 17:37

I have two folders, folder1 and folder2 with around 200 files each that are either *rda or *R. I want to read all of the

3条回答
  •  青春惊慌失措
    2020-12-23 18:11

    for (f in list.files(pattern="*.R")) {
        source(f)
    }
    for (f in list.files(pattern="*.rda")) {
        load(f)
    }
    

提交回复
热议问题