Re: [R] Index out SNP position

2013-01-04 Thread David L Carlson
arl...@tamu.edu; r-help@r-project.org Cc: sarah.gos...@gmail.com Subject: RE: [R] Index out SNP position Hi David,   Thanks for your reply!   But what if I cannot change the positions of each row pairs in A. Sorry I did not make it very clear.   The two columns in A represent start-and-end or end-

Re: [R] Index out SNP position

2013-01-03 Thread David Winsemius
On Jan 3, 2013, at 1:54 PM, JiangZhengyu wrote: > > > > > > > Dear R experts, > > I have 2 matix: A& B. I am trying to index B against A - (1) find out B rows > that fall between the col 1 and 2 of A& put them into a new vector SNP.I > made code as below, but I cannot think of a right w

Re: [R] Index out SNP position

2013-01-03 Thread JiangZhengyu
index out all the single nucleotides that fall between the start and end region of a gene. Jiang > From: dcarl...@tamu.edu > To: dcarl...@tamu.edu; zhyjiang2...@hotmail.com; r-help@r-project.org > CC: sarah.gos...@gmail.com > Subject: RE: [R] Index out SNP position > Date: Thu, 3 Ja

Re: [R] Index out SNP position

2013-01-03 Thread David L Carlson
-- > David L Carlson > Associate Professor of Anthropology > Texas A&M University > College Station, TX 77843-4352 > > > -Original Message- > > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > > projec

Re: [R] Index out SNP position

2013-01-03 Thread David L Carlson
Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of JiangZhengyu > Sent: Thursday, January 03, 2013 3:55 PM > To: r-help@r-project.org > Subject: [R] Index out SNP position > > > > &g

Re: [R] Index out SNP position

2013-01-03 Thread Sarah Goslee
t; Actually, I have over 10,000 in B and over 5000 ranges in A. What if I only > need to take out all the B rows that fall into the ranges of A? - remove the > repetitive results. > > Best, > Jiang > >> Date: Thu, 3 Jan 2013 17:04:59 -0500 >> Subject: Re: [R] Index

Re: [R] Index out SNP position

2013-01-03 Thread JiangZhengyu
Thu, 3 Jan 2013 17:04:59 -0500 > Subject: Re: [R] Index out SNP position > From: sarah.gos...@gmail.com > To: zhyjiang2...@hotmail.com > CC: r-help@r-project.org > > Assuming I understand what you want, which I'm not certain of, here's > one way; there are more (probabl

Re: [R] Index out SNP position

2013-01-03 Thread Sarah Goslee
Assuming I understand what you want, which I'm not certain of, here's one way; there are more (probably some more elegant). I'm not sure how you'd put them in a vector, since there are different numbers of values for each row of A, so instead I've made a list. unlist(SNP) will turn it into a vecto

[R] Index out SNP position

2013-01-03 Thread JiangZhengyu
Dear R experts, I have 2 matix: A& B. I am trying to index B against A - (1) find out B rows that fall between the col 1 and 2 of A& put them into a new vector SNP.I made code as below, but I cannot think of a right way to do it. Could anyone help me with the code? Thanks,Jiang A