Re: [R] strsplit with invalid regular expression

2012-11-08 Thread Jeff Newmiller
In R, the source code representation of a special character uses the \ as an escape character to begin a special character sequence. For example, "\n" is a single newline character. Because backslash has this special meaning, to represent a single backslash character one must escape it: "\\" lo

Re: [R] strsplit with invalid regular expression

2012-11-08 Thread arun
HI, cond<-"andsin(log_angle_1_4)"  diff_operator<-"sin\\("  strsplit(cond,diff_operator) #[[1]] #[1] "and"    "log_angle_1_4)" A.K. - Original Message - From: Bharat Warule To: r-help@r-project.org Cc: Sent: Thursday, Novem

Re: [R] strsplit with invalid regular expression

2012-11-08 Thread Ulrich Staudinger
> strsplit(")asdasdsin(abcd)", "sin\\(") [[1]] [1] ")asdasd" "abcd)" > On Thu, Nov 8, 2012 at 12:39 PM, Bharat Warule wrote: > Hi all, > > > diff_operator <- "\\(" > > strsplit(cond, diff_operator) > [[1]] > [1] "andsin" "log_angle_1_4)" > > > diff_operator <- "\\sin(" > > strsplit(co

[R] strsplit with invalid regular expression

2012-11-08 Thread Bharat Warule
Hi all, > diff_operator <- "\\(" > strsplit(cond, diff_operator) [[1]] [1] "andsin" "log_angle_1_4)" > diff_operator <- "\\sin(" > strsplit(cond, diff_operator) Error in strsplit(cond, diff_operator) : invalid regular expression '\sin(', reason 'Missing ')'' When I am going to split w