[R] recognizing "(" as a character

Thomas Lumley tlumley at u.washington.edu
Sat Nov 15 18:22:01 CET 2003


On Sat, 15 Nov 2003, Henrik Bengtsson wrote:

> You have to escape (="\\") such "special" characters, e.g.
>
>  strsplit("abc(d)(e)", split="\\(")
>
> or put them in brackets (matches sets of characters)
>
>  strsplit("abc(d)(e)", split="[(]")
>
> if you think that is more readable. Similar for gsub(), grep(),
> regexpr() and friends.
>

For all except (unfortunately) strsplit() there is now a fixed=TRUE
argument to make this unnecessary.

	-thomas




More information about the R-help mailing list