How to create multiple ,csv files in R?

后端 未结 3 1615
礼貌的吻别
礼貌的吻别 2021-01-15 05:42

I have a .csv file with data for different chromosomes. The chromosomes names are stored in the first column(column name: Chr). My aim is to separate the data for each chrom

3条回答
  •  Happy的楠姐
    2021-01-15 05:59

    Illustrating a one liner using plyr and the dataset iris

    plyr::d_ply(iris, .(Species), function(x) write.csv(x, 
      file = paste(x$Species, ".csv", sep = "")))
    

提交回复
热议问题