Re: [Rd] random output with sub(fixed = TRUE)

2005-12-21 Thread Duncan Murdoch
On 12/21/2005 5:13 PM, Roger D. Peng wrote: > Well, who am I to break this long-standing ritual? :) > > Interestingly, while the printed output looks wrong, I get > > > v <- paste(0:10, "asdf", sep = ".") > > a <- sub(".asdf", "", v, fixed = TRUE) > > b <- as.character(0:10) > > identical(a,

Re: [Rd] random output with sub(fixed = TRUE)

2005-12-21 Thread Prof Brian Ripley
On Wed, 21 Dec 2005, Roger D. Peng wrote: > Well, who am I to break this long-standing ritual? :) > > Interestingly, while the printed output looks wrong, I get > > > v <- paste(0:10, "asdf", sep = ".") > > a <- sub(".asdf", "", v, fixed = TRUE) > > b <- as.character(0:10) > > identical(a, b) > [1

Re: [Rd] random output with sub(fixed = TRUE)

2005-12-21 Thread Roger D. Peng
Well, who am I to break this long-standing ritual? :) Interestingly, while the printed output looks wrong, I get > v <- paste(0:10, "asdf", sep = ".") > a <- sub(".asdf", "", v, fixed = TRUE) > b <- as.character(0:10) > identical(a, b) [1] TRUE > -roger Peter Dalgaard wrote: > "Roger D. Pe

Re: [Rd] random output with sub(fixed = TRUE)

2005-12-21 Thread Peter Dalgaard
"Roger D. Peng" <[EMAIL PROTECTED]> writes: > I've noticed what I think is curious behavior in using 'sub(fixed = TRUE)' > and > was wondering if my expectation is incorrect. Here is one example: > > v <- paste(0:10, "asdf", sep = ".") > sub(".asdf", "", v, fixed = TRUE) > > The results I get

[Rd] random output with sub(fixed = TRUE)

2005-12-21 Thread Roger D. Peng
I've noticed what I think is curious behavior in using 'sub(fixed = TRUE)' and was wondering if my expectation is incorrect. Here is one example: v <- paste(0:10, "asdf", sep = ".") sub(".asdf", "", v, fixed = TRUE) The results I get are > sub(".asdf", "", v, fixed = TRUE) [1] "0"