Displaying 3 results from an estimated 3 matches for "dpa1".
Did you mean:
da1
2009 Aug 12
4
paste first row string onto every string in column
Hi,
I am trying to edit a data frame such that the string in the first line is
appended onto the beginning of each element in the subsequent rows. The data
looks like this:
> df
V1 V2 V3 V4
1 DPA1* DPA1* DPB1* DPB1*
2 0103 0104 0401 0601
3 0103 0103 0301 0402
.
.
and what I want is this:
>dfnew
V1 V2 V3 V4
1 DPA1* DPA1* DPB1* DPB1*
2 DPA1*0103 DPA1*0104 DPB1*0401 DPB1*0601
3 DPA1*0103 DPA1*0103 DPB1*0301 DPB1*0402
any help is much appreciated, I am new to...
2009 Aug 12
0
Re : paste first row string onto every string in column
...in 1 :4){
A[i] <- paste(data[1,i],data[2,i])
B[i] <- paste(data[1,i],data[3,i])
}
A
B
(data1 <- rbind(as.character(A),as.character(B)))
(data2 <- rbind(C,data1))
normaly that gives that
> (data <- read.csv2("c:/jill.csv", sep=","))
V1 V2 V3 V4
1 DPA1* DPA1* DPB1* DPB1*
2 103 104 401 601
3 103 103 301 402
> (C<-data[1,])
V1 V2 V3 V4
1 DPA1* DPA1* DPB1* DPB1*
> A <- numeric(4)
> B <- numeric(4)
> for (i in 1 :4){
+ A[i] <- paste(data[1,i],data[2,i])
+ B[i] <- paste(data[1,i],data[3,i])
+ }...
2007 Jun 24
2
matlab/gauss code in R
...able is similar as before:
> >
> > > y
> > Fnd locus Freq color
> > 1 signeg DPB1 0.013071895 gray1
> > 2 neg DPB1 0.581699346 gray35
> > 3 pos DPB1 0.379084967 gray45
> > 4 sigpos DPB1 0.026143791 gray65
> > 5 signeg DPA1 0.068181818 gray1
> > 6 neg DPA1 0.659090909 gray35
> > 7 pos DPA1 0.250000000 gray45
> > 8 sigpos DPA1 0.022727273 gray65
> >
> >
> >
> > hadley wrote:
> > >
> > > Hi Owen,
> > >
> > > The identity scale won...