Re: [R] Reading in and modifying multiple datasets in a loop

2011-10-26 Thread Uwe Ligges
On 24.10.2011 23:10, Debs Majumdar wrote: Thanks Uwe. This works perfectly. ### owd<- setwd(pth) fls<- list.files(pattern="^chr") ufls<- unique(sapply(strsplit(fls, "_"), "[", 1)) for(i in ufls){ of<- strsplit(i, "\\.")[[1]] of<- paste(of[1], tail(of, 1), sep=".") imput

Re: [R] Reading in and modifying multiple datasets in a loop

2011-10-24 Thread Debs Majumdar
Thanks Uwe. This works perfectly. ### owd <- setwd(pth) fls <- list.files(pattern="^chr") ufls <- unique(sapply(strsplit(fls, "_"), "[", 1)) for(i in ufls){      of <- strsplit(i, "\\.")[[1]]      of <- paste(of[1], tail(of, 1), sep=".")      impute2databel(genofile = i,              

Re: [R] Reading in and modifying multiple datasets in a loop

2011-10-22 Thread Uwe Ligges
On 21.10.2011 23:32, Debs Majumdar wrote: Hi, I have been given a set of around 300 files where there are 5 files corresponding to each chunk. E.g. Chunk 1 for chr1 contains these 5 files: chr1.one.phased.impute2.chunk1 chr1.one.phased.impute2.chunk1_info chr