[R] transpose but different

2010-04-13 Thread Duijvesteijn, Naomi
Hi all, I want to make extra columns in my datafile where the id of every groupmember is mentioned in separate columns. To explain it better see the example: id<-c(1,2,3,4,5,6,7,8,9,10,11,12) group<-c(1,1,1,1,2,2,3,3,3,3,3,3) a<-as.data.frame(cbind(id,group))

[R] problem tick marker and text

2009-11-27 Thread Duijvesteijn, Naomi
Hi R-ers, I am struggling with my x-axis in a association plot. What I would like is to place the labels of the x-axis between the tick markers and normally the labels are printed at the place where the tick marker is placed. I don’t want to move the tick marker (it gives the sw

[R] two graphs 1 x-axis

2009-10-16 Thread Duijvesteijn, Naomi
Dear R-people I have a question concerning plotting graphs. Here an example dataset a<-c(1,2,3,4,5,6) b<-c(3,5,4,6,1,1) c<-c(1,1,1,1,1,1) d<-as.data.frame(cbind(a,b,c)) plot.new() plot(d$a, d$b, col="red") par(new=TRUE) plot(d$a,d$c, col="red", pch="|") What I would want is to plot de second p

[R] strsplit for multiple columns

2009-06-03 Thread Duijvesteijn, Naomi
Hi, I am trying to split multiple columns. One column works just fine, but I want to do it for multiple columns… Example > a ID V2 V3 V4 V5 V6 V7 V8 V9 V10 1 PBBA0644 -- GG AA -- AA -- AA GG GG 2 PBBA1010 -- GG AA -- AA -- AA GG GG 3 0127ATPR -- GG AA -- AA

[R] data.fram zero's

2009-04-09 Thread Duijvesteijn, Naomi
Hi all, A simple question which I don’t seem to be able to solve: I want to make a data.frame of 360 rows and 94228 column with only zero’s without having to type all these zero’s ;-) What is the easiest method? Thanks, Naomi Disclaimer: De inf

[R] same value in column-->delete

2009-03-26 Thread Duijvesteijn, Naomi
Hi Readers, I have a question. I have a large dataset and want to throw away columns that have the same value in the column itself and I want to know which column this was. For example > x<-data.frame(id=c(1,2,3), snp1=c("A","G", "G"),snp2=c("G","G","G"),snp3=c("G","G",

[R] FW: reshape dataframe

2009-03-20 Thread Duijvesteijn, Naomi
Hi, I have a large dataset on which I would like to do the following: x<-data.frame(id=c(1,2,3), snp1=c("AA","GG", "AG"),snp2=c("GG","AG","GG"),snp3=c("GG","AG","AA")) > x id snp1 snp2 snp3 1 1 AA GG GG 2 2 GG AG AG 3 3 AG GG AA And

[R] reshape dataframe

2009-03-20 Thread Duijvesteijn, Naomi
Hi, I have a large dataset on which I would like to do the following: x<-data.frame(id=c(1,2,3), snp1=c("AA","GG", "AG"),snp2=c("GG","AG","GG"),snp3=c("GG","AG","AA")) > x id snp1 snp2 snp3 1 1 AA GG GG 2 2 GG AG AG 3 3 AG GG AA And