[R] partial matching with grep()

Vito Muggeo (UniPa) vito.muggeo at unipa.it
Mon Nov 2 15:57:29 CET 2009


dear all,
This is a probably a silly question.
If I type
 > grep("x",c("a.x" ,"b.x","a.xx"),value=TRUE)
[1] "a.x"  "b.x"  "a.xx"

Instead, I would like to obtain only
"a.x"  "b.x"
How is it possible to get this result with grep()?

many thanks for your attention,
best,
vito

-- 
====================================
Vito M.R. Muggeo
Dip.to Sc Statist e Matem `Vianelli'
Università di Palermo
viale delle Scienze, edificio 13
90128 Palermo - ITALY
tel: 091 6626240
fax: 091 485726/485612
http://dssm.unipa.it/vmuggeo




More information about the R-help mailing list