Created
July 14, 2015 12:44
-
-
Save kdiverson/460d31aecadf3e8f5d92 to your computer and use it in GitHub Desktop.
multimerge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
multmerge = function(mypath){ | |
filenames=list.files(path=mypath, full.names=TRUE) | |
datalist = lapply(filenames, function(x){read.delim(file=x,header=T)}) | |
} | |
multmerge = function(mypath){ | |
filenames=list.files(path=mypath, full.names=TRUE) | |
datalist = lapply(filenames, function(x){read.table(pipe("cut -f1,2,3,4,5,6 myFile.txt"))}) | |
Reduce(function(x,y) {merge(x,y)}, datalist) | |
} | |
mkdir trimed && for i in *.species; do cut -f1,2,3,4,5,6 $i > trimmed/$i.trimmed; done; | |
mymergeddata = multmerge("trimmed") | |
library("plyr") | |
df<-rbind.fill(mymergeddata) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment