My mistake... last alternative should be: c<-subset(c,regexpr("\\.1|\\.5|\\.6|\\.99999",rownames(c)) < 0)
--- Stephen Tucker <[EMAIL PROTECTED]> wrote: > You can list them together using "|" (which stands for 'or'): > > c<-subset(c,!rownames(c) %in% > grep(".1|.5|.6|.99999",rownames(c),value=T)) > > but "." means any character for regular expressions, so if you meant a > decimal place, you probably want to escape them with a "\\": > > c<-subset(c,!rownames(c) %in% > grep("\\.1|\\.5|\\.6|\\.99999", rownames(c),value=T)) > > Another option is > > c<-subset(c,regexpr("\\.1|\\.5|\\.6|\\.99999",c) < 0) > > because regexpr will return -1 for elements which do not contain a match. > > > --- Ana Patricia Martins <[EMAIL PROTECTED]> wrote: > > > Hello R-users and developers, > > > > Once again, I'm asking for your help. > > > > There is other way to do the same more easily for applied simultaneous > > grep??? > > > > c<-subset(c,!rownames(c) %in% grep(".1",rownames(c),value=T)) > > c<-subset(c,!rownames(c) %in% grep(".5",rownames(c),value=T)) > > c<-subset(c,!rownames(c) %in% grep(".6",rownames(c),value=T)) > > c<-subset(c,!rownames(c) %in% grep(".99999",rownames(c),value=T)) > > > > Thanks in advance for helping me. > > > > Atenciosamente, > > Ana Patricia Martins > > ------------------------------------------- > > Serviço Métodos Estatísticos > > Departamento de Metodologia Estatística > > INE - Portugal > > Telef: 218 426 100 - Ext: 3210 > > E-mail: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > > > > > > [[alternative HTML version deleted]] > > > > > ______________________________________________ > > R-help@stat.math.ethz.ch 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. > > > > ______________________________________________ > R-help@stat.math.ethz.ch 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. > ______________________________________________ R-help@stat.math.ethz.ch 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.