I'm using the grep
function in R to check if a conditional regular expression is met.
What I have is this: grep(expression, string)
where an example might be
value= grep("\\s[A-z]", " ")
value
which outputs
integer(0)
What I want to be able to do is check is if value == integer(0)
and
return TRUE if value
is integer(0)
return FALSE if value
is not integer(0)
Is there a way to do this in R? If there are alternatives, I am open to them. For example, grep might have an option to output the result as a logical value,
TRUE and FALSE, or
0 and 1 or something related.