Dear all! Is there a possibility to replace all duplicates values in data frame with 0? Thank you very much! -- --- 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 [[alternative HTML version deleted]]
Hi Catalin, The following should give you some ideas: set.seed(123) x <- rpois(50, 2) x idx <- duplicated(x) x[idx] <- 0 x Best, Jorge.- On Thu, Mar 13, 2014 at 11:35 PM, catalin roibu <catalinroibu@gmail.com>wrote:> Dear all! > > Is there a possibility to replace all duplicates values in data frame with > 0? > > Thank you very much! > > > > -- > --- > 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 > > [[alternative HTML version deleted]] > > ______________________________________________ > 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. >[[alternative HTML version deleted]]
Hello, See ?duplicated Something like dat1[duplicated(dat1), ] <- 0 Hope this helps, Rui Barradas Em 13-03-2014 12:35, catalin roibu escreveu:> Dear all! > > Is there a possibility to replace all duplicates values in data frame with > 0? > > Thank you very much! > > >
Hello, Dis you at least search? ?duplicated Regards, Pascal On Thu, Mar 13, 2014 at 9:35 PM, catalin roibu <catalinroibu at gmail.com> wrote:> Dear all! > > Is there a possibility to replace all duplicates values in data frame with > 0? > > Thank you very much! > > > > -- > --- > 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 > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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.-- Pascal Oettli Project Scientist JAMSTEC Yokohama, Japan