Reading 100 csv files and writing and save the overall mean, SD, Max,Min, and quantile (5,15,85,90%)

Viewed 43

I need to write a code can read 100 csv ( names from "sc01" to "sc100") files and extract some basic statistics and save the overall ( for each column of each file) e.g. Mean, SD, Max,Min, and quantile (5,15,85,90%). I have two locations so I filtered them based on the X positions:

For location 1
 Data1<- select(filter(exprs_data,XPos>= -2562 & XPos<= -2060),c(4,5,6,7,11,12,13,14,16,19,20,25,26,27))
#Calculate 5,15,80,85,90,and 95 percentiles
Per=apply(Data1[],2, quantile, probs=c(0.05, 0.15,0.80, 0.85, 0.9, 0.95))

#For location 2
Data2<- select(filter(exprs_data,XPos>= -2562 & XPos<= -2060),c(4,5,6,7,11,12,13,14,16,19,20,25,26,27))
per1=apply(Data2[],2, quantile, probs=c(0.05, 0.15,0.80, 0.85, 0.9, 0.95))

I need to loop over each file of the 100 files and get the above data for each column then save all of the data in CVS file. Thanks

0 Answers
Related