Displaying 1 result from an estimated 1 matches for "trygrep".
Did you mean:
rgrep
1999 Oct 11
1
if(grep())
Would anyone care to comment if this is the best solution to this problem?
> trygrep <-function(x,y)
+ if(grep(x,y))
+ print("yes") else
+ print("NO")
>
>trygrep("foo","bafoobar")
[1] "yes"
>
> trygrep("foo","bar")
Error in if (grep(x, y)) print("yes") else print("NO") : missi...