murdoch.duncan at gmail.com
Mon May 13 12:48:26 CEST 2013
On 13-05-13 4:19 AM, Francesco Isotta wrote:
> it is not clear to me, how to search if in a string there is a "." (full
> doesn't work because the full stop it is a metacharacter (it gives "TRUE"
> also if no full stop is in the character).
Use grepl(".", string, fixed=TRUE).
I tried also to insert \. but it
> does not work.
You did not insert \., because you'd need to escape the backslash to do
that. grepl("\\.", string) would work.
> Error: '\.' is an unrecognized escape in character string starting "\."
> Thank you very much for your help
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help