Well I don't see anything that looks like a year but go from this dat1[match(2, dat1$samp.depth),] and pick off what you want I guess
John Kane Kingston ON Canada -----Original Message----- From: catalinro...@gmail.com Sent: Tue, 27 Aug 2013 20:46:27 +0300 To: jrkrid...@inbox.com Subject: Re: [R] find row name with specific value Thank you! But I want to view to year, not the row index. Is there a possibility? On 27 August 2013 20:41, John Kane <jrkrid...@inbox.com> wrote: with data named dat1 match(2, dat1$samp.depth) John Kane Kingston ON Canada > -----Original Message----- > From: catalinro...@gmail.com > Sent: Tue, 27 Aug 2013 20:24:04 +0300 > To: r-help@r-project.org > Subject: [R] find row name with specific value > > Hello all! > I want to find the first year where is fixed value (eg 2). > My data is like this: > HUMstd HUMres samp.depth > 1592 0.5687519 NA 1 > 1593 1.5251896 NA 1 > 1594 1.8168727 NA 1 > 1595 1.1265923 0.8253599 1 > 1596 0.8725422 0.7423323 2 > 1597 0.6744835 0.5443933 2 > 1598 0.7605894 0.8698533 2 > 1599 0.6559708 0.8695049 2 > 1600 0.8606666 0.4699240 3 > 1601 1.0398217 1.0643867 3 > 1602 0.5707846 0.7079530 3 > 1603 0.5136122 0.8443149 3 > 1604 0.6700944 0.9767793 3 > 1605 0.7239053 0.9378163 3 > 1606 0.6772079 0.8428935 3 > 1607 0.9368149 1.0333812 3 > 1608 0.7091008 0.7860034 3 > 1609 1.1177742 1.2792296 3 > > Thank you! > > - > --- > Catalin-Constantin ROIBU > Lecturer PhD, Forestry engineer > Forestry Faculty of Suceava > Str. Universitatii no. 13, Suceava, 720229, Romania > office phone +4 0230 52 29 78, ext. 531 > mobile phone +4 0745 53 18 01 > +4 0766 71 76 58 > FAX: +4 0230 52 16 64 > silvic.usv.ro [http://silvic.usv.ro] > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > [https://stat.ethz.ch/mailman/listinfo/r-help] > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > [http://www.R-project.org/posting-guide.html] > and provide commented, minimal, self-contained, reproducible code. ____________________________________________________________ GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys [http://www.inbox.com/smileys] Works with AIM®, MSN® Messenger, Yahoo!® Messenger, ICQ®, Google Talk™ and most webmails -- --- Catalin-Constantin ROIBU Lecturer PhD, Forestry engineer Forestry Faculty of Suceava Str. Universitatii no. 13, Suceava, 720229, Romania office phone +4 0230 52 29 78, ext. 531 mobile phone +4 0745 53 18 01 +4 0766 71 76 58 FAX: +4 0230 52 16 64 silvic.usv.ro [http://silvic.usv.ro] ____________________________________________________________ FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop! ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.