Read and rbind multiple csv files

前端 未结 3 1733
心在旅途
心在旅途 2020-12-06 13:23

I have a series of csv files (one per anum) with the same column headers and different number of rows. Originally I was reading them in and merging them like so;

         


        
3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-06 13:31

    If you're looking for speed, then try this:

    require(data.table) ## 1.9.2 or 1.9.3
    ans = rbindlist(lapply(filenames, fread))
    

提交回复
热议问题