Re: [R] Strplit code

2011-09-20 Thread William Dunlap
To: William Dunlap > Cc: Santosh; R help > Subject: Re: [R] Strplit code > > Pardon my ignorance, but why is the do.call necessary? why not just execute > the rbind function? > What's the advantage in putting it in a do.call "wrapper"? > > On Sep 20,

Re: [R] Strplit code

2011-09-20 Thread MK
gt; that gives the name of the function, so replace > do.call(rbind, ...) > with > do.call("rbind", ...) > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > From: Santosh [mailto:santosh2...@gmail.com] > Sent: Tuesday, September 20, 2011 2:55

Re: [R] Strplit code

2011-09-20 Thread William Dunlap
0, 2011 2:55 AM To: William Dunlap; R help Subject: Re: [R] Strplit code Dear R- Splus experts, In R, I have frequently used do.call with strsplit. and I have a hard time with Splus.. any suggestions? for example, the R code below: do.call(rbind,strsplit(paste(letters[1:10],c(1:10)),"

Re: [R] Strplit code

2011-09-20 Thread Santosh
lap wrote: > [R] Strplit code > pomchip at free.fr pomchip at free.fr > Wed Dec 3 20:52:21 CET 2008 > > Dear R-users, > > The strsplit function does not exist in S-plus and I would like to > use it. How > could I reproduce the function in Splus or access to

Re: [R] Strplit code

2008-12-05 Thread William Dunlap
[R] Strplit code pomchip at free.fr pomchip at free.fr Wed Dec 3 20:52:21 CET 2008 Dear R-users, The strsplit function does not exist in S-plus and I would like to use it. How could I reproduce the function in Splus or access to its source code? Thank you in advance

Re: [R] Strplit code

2008-12-05 Thread Wacek Kusnierczyk
John Fox wrote: > Dear Wacek, > > I've thought a bit more about this problem, and recall that I originally > wrote Strsplit() [and replacements for sub() and gsub(), which were not then > in S-PLUS] for the version of the car package that I released for S-PLUS, > because other functions in the pack

Re: [R] Strplit code

2008-12-05 Thread John Fox
replacement for gregexpr(). > -Original Message- > From: Wacek Kusnierczyk [mailto:[EMAIL PROTECTED] > Sent: December-04-08 7:29 AM > To: John Fox > Cc: R help > Subject: Re: [R] Strplit code > > John Fox wrote: > > Dear Wacek, > > > > "Wrong"

Re: [R] Strplit code

2008-12-04 Thread Wacek Kusnierczyk
Gabor Grothendieck wrote: > R does not support tail recursion so not using it would > not matter. > > this is a feature, i guess. another issue is that the recursive calls receive substrings as arguments, which means copying the whole remaining content, and the copies would not be deallocated

Re: [R] Strplit code

2008-12-04 Thread Gabor Grothendieck
R does not support tail recursion so not using it would not matter. On Thu, Dec 4, 2008 at 5:04 AM, Wacek Kusnierczyk <[EMAIL PROTECTED]> wrote: > John Fox wrote: >> By coincidence, I have a version of strsplit() that I've used to >> illustrate recursion: >> >> Strsplit <- function(x, split){ >>

Re: [R] Strplit code

2008-12-04 Thread Wacek Kusnierczyk
John Fox wrote: > Dear Wacek, > > "Wrong" is a bit strong, I think -- limited to single-pattern characters is > more accurate. nothing is ever wrong if seen from an appropriate perspective. for example, there is nothing wrong in that many core functions in r deparse some, but not all, of the arg

Re: [R] Strplit code

2008-12-04 Thread John Fox
sage- > From: Wacek Kusnierczyk [mailto:[EMAIL PROTECTED] > Sent: December-04-08 5:05 AM > To: John Fox > Cc: R help > Subject: Re: [R] Strplit code > > John Fox wrote: > > By coincidence, I have a version of strsplit() that I've used to > > illust

Re: [R] Strplit code

2008-12-04 Thread Wacek Kusnierczyk
John Fox wrote: > By coincidence, I have a version of strsplit() that I've used to > illustrate recursion: > > Strsplit <- function(x, split){ > if (length(x) > 1) { > return(lapply(x, Strsplit, split)) # vectorization > } > result <- character(0) > if (nchar(x) == 0) r

Re: [R] Strplit code

2008-12-03 Thread John Fox
Dear Brian (and original poster), My apologies -- I didn't notice the original posting. By coincidence, I have a version of strsplit() that I've used to illustrate recursion: Strsplit <- function(x, split){ if (length(x) > 1) { return(lapply(x, Strsplit, split)) # vectorization

Re: [R] Strplit code

2008-12-03 Thread Prof Brian Ripley
On Wed, 3 Dec 2008, [EMAIL PROTECTED] wrote: Dear R-users, The strsplit function does not exist in S-plus and I would like to use it. How could I reproduce the function in Splus or access to its source code? With difficulty, as it is almost entirely implemented in C code (in src/main/charact

[R] Strplit code

2008-12-03 Thread pomchip
Dear R-users, The strsplit function does not exist in S-plus and I would like to use it. How could I reproduce the function in Splus or access to its source code? Thank you in advance, Sebastien __ R-help@r-project.org mailing list https://stat.ethz.