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
Illustrating a one liner using plyr and the dataset iris
plyr
iris
plyr::d_ply(iris, .(Species), function(x) write.csv(x, file = paste(x$Species, ".csv", sep = "")))