Breakdown gclust440 into 25 files
outlook email title: break down a file
Feb 15th 2021
CH slack, Feb 16th 2021
outlook email title: break down a file
Feb 15th 2021
CH slack, Feb 16th 2021
Location on server: /space/chen-syn01/1/data/cinliu/data/gclust440_subsetdat
Can you please help break down the data in this file into ~26 files so that each brain region as shown in column B has an individual file?
File given: galust440loci.xlsx
Each file looks a little something like this
subset.R
rm(list=ls())
setwd("/Users/nini/Desktop/2021lab/CH/subsetdat/")
dat <- read_excel("gclust440loci.xlsx",sheet = "Sheet1", skip = 1)
x <- unique(dat$region)
for (i in 1:25) {
df <- dat[dat$region == x[i], ]
write.table(df, paste0("/Users/nini/Desktop/2021lab/CH/subsetdat/data/",x[i],".txt"),quote = FALSE,row.names = FALSE, col.names = TRUE)
}