Write list of data.frames to separate CSV files with lapply

前端 未结 3 1767
伪装坚强ぢ
伪装坚强ぢ 2020-11-29 02:11

The question says it all - I want to take a list object full of data.frames and write each data.frame to a separate .csv file where the name of the .csv file corresponds to

3条回答
  •  旧巷少年郎
    2020-11-29 02:23

    You could use mapply:

    mapply(
      write.table,
      x=df.daily, file=paste(names(df.daily), "txt", sep="."),
      MoreArgs=list(row.names=FALSE, sep=",")
    )
    

    There is thread about similar problem on plyr mailing list.

提交回复
热议问题