[R] checking certain digits of a number in a column

David Winsemius dwinsemius at comcast.net
Sat Jun 15 06:45:48 CEST 2013


On Jun 14, 2013, at 9:33 PM, Yasin Gocgun wrote:

> Hi,
> 
> I need to check whether certain digits of a number, say, last five digits,
> appear in a column of a data frame. For instance,
> 
> For example,103 in "000103" (  data [data[,3] == "...103"] instead of
> data [data[,3] == "000103"] ) or 54780 in "12354780". Can someone let me
> know how to do so.
> 

R has a 'substr' function.

--
David Winsemius
Alameda, CA, USA



More information about the R-help mailing list