Skip to content
Back to formatted view

Raw Message

Message-ID: <2604181.3BIPRN9hVz@augeatur>
Date: 2013-06-15T04:48:26Z
From: Rainer Schuermann
Subject: checking certain digits of a number in a column
In-Reply-To: <CAJJuoETJVSDqyHXT-Fz0vQrfkfYU6p995jekSL210AmD9ct7XA@mail.gmail.com>

Try
?grep

or
library( stringr )
?str_detect




On Saturday 15 June 2013 00:33:31 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.
> 
> Thanks in advance,
> 
> Yasin
> 
> 	[[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.