[R] Rle function to expand for many samples

2011-09-28 Thread sujitha
Dear R experts, code: >m<-read.table("test.txt",sep='\t',header=TRUE,colClasses=c('character','integer','integer','rep('numeric',150)) > s<-data.frame(c(rle(m$Sample1)[[2]],rle(m$Sample2)[[2]],rle(m$Sample3)[[2]]),c(rle(m$Sample1)[[1]],rle(m$Sample2)[[1]],rle(m$Sample3)[[1]])) > names(s)=c("Values"

[R] How to Store the executed values in a dataframe & rle function

2011-09-26 Thread sujitha
Hi group, This is how my test file looks like: Chr start end sample1 sample2 chr2 9896633 9896683 0 0 chr2 9896639 9896690 0 0 chr2 14314039 14314098 0 -0.35 chr2 14404467 14404502 0 -0.35 chr2 14421718 14421777 -0.43 -0.35 chr2 16031710 16031769 -0.43 -0.35 chr2 16036178 16036237 -0.43 -

Re: [R] R functions

2011-09-23 Thread sujitha
Hi group, code: >m<-read.table("test.txt",sep='\t',header=TRUE,colClasses=c('character','integer','integer','numeric','numeric')) > >s<-data.frame(c(rle(m$Sample1)[[2]],rle(m$Sample2)[[2]]),c(rle(m$Sample1)[[1]],rle(m$Sample2)[[1]])) > > names(s)=c("Values","Probes") >G=1 > for(i in 1:length(s$P

Re: [R] R functions

2011-09-16 Thread sujitha
Hi, Thanks for your reply. I converted using your idea and since I have big file I thought reading as a table would help. This is just snippet of my data. I have around 150 samples so wrting s in that form would be tedious. >m<-read.table("test.txt",sep='\t',header=TRUE,colClasses=c('character','in

[R] R functions

2011-09-15 Thread sujitha
Hi group, I am trying to right a code to do the following This is how the test file looks like: Chr start end sample1 sample2 chr2 9896633 9896683 0 0 chr2 9896639 9896690 0 0 chr2 14314039 14314098 0 -0.35 chr2 14404467 14404502 0 -0.35 chr2 14421718 14421777 -0.43 -0.35 chr2 16031710 16031769 -0.