Ulrich wrote:
Hi,
is it possible to easily change the return value for the grep function
for cases where there is no match, for example the value 0 or "No"
instead of integer (0) )?
It sounds like you might want grepl (which returns a vector of TRUE and
FALSE values) rather than grep (whi
On Oct 30, 2010, at 11:13 PM, David Winsemius wrote:
On Oct 30, 2010, at 10:51 PM, Ulrich wrote:
Hi,
is it possible to easily change the return value for the grep
function for cases where there is no match, for example the value 0
or "No" instead of integer (0) )?
Seems like is shou
On Sat, Oct 30, 2010 at 10:51 PM, Ulrich wrote:
> Hi,
>
> is it possible to easily change the return value for the grep function for
> cases where there is no match, for example the value 0 or "No" instead of
> integer (0) )?
>
Try this:
> Find(length, list(grep("X", letters), 0))
[1] 0
> Find(l
On Oct 30, 2010, at 10:51 PM, Ulrich wrote:
Hi,
is it possible to easily change the return value for the grep
function for cases where there is no match, for example the value 0
or "No" instead of integer (0) )?
Seems like is should be pretty easy. Test for length(grep(...)) == 0
or
Hi,
is it possible to easily change the return value for the grep function
for cases where there is no match, for example the value 0 or "No"
instead of integer (0) )?
Thanks, Uli
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/
5 matches
Mail list logo