h individual and the j-th variant would become d_ij
>>> new=2-dij.
>>> Dosage [j,]=2-dosage[j,]
>>> My desire data frame looks like
>>> Dataframe new
>>> SNPID" "OA" "EA" id1 id2 id3 id4 id5
>&
;"G" "A" 2- 1.02 2- 2
>> 2-1
>> 2-2 2- 2
>> "snp003""C" "A" 11.03
>> 2
>> 0 1
>>
ot;"C" "T" 1 0
1.01 11
can you help me the r code for the above.
Kind regards,
Hana
On 6/12/22, hanatezera wrote:
Dear Jim, Thanks a lot this is exactly i am looking for.S
uot;A" 2-1.02 2-1.99
> 2-2 2-1.02 2-1.98
> "snp005""C" "T" 10
> 1.01 11
> can you help me the r co
.
> For instance i am looking the data
> mydf
> IDnumber OA EA beta
> 11 A C 0.050
> 22 G A 0.098
> 33 T G 0.789
>
> Best,
> Hana
>
>
>
> Original message
> From: Jim Lemon
> Date: 6/12/22 1:59 AM (GMT+03:
Date:
6/12/22 1:59 AM (GMT+03:00) To: hanatezera , r-help
mailing list Subject: Re: [R] Changing sign of columns
and values Hi Hana,I think this is what you want:# first read in your
examplemydf<-read.table(text="IDnumber OA EA beta1 C A -0.052
G A
Hi Hana,
I think this is what you want:
# first read in your example
mydf<-read.table(text=
"IDnumber OA EA beta
1 C A -0.05
2 GA0.098
3 GT-0.789",
header=TRUE,stringsAsFactors=FALSE)
# check it
mydf
IDnumber OA EA beta
11 C A -0.05
This is a plain text list. Your html post got mangled (see below). You
are more likely to get a useful response if you follow the posting
guide (linked below) and post in plain text.
Bert Gunter
"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-
I have the following data set in data frameIDnumber OA EA beta1
C A -0.052 G A
0.0983 G T -0.789I want to change
the sign of negative beta. If the negative value change to post
9 matches
Mail list logo