Re: [R] Retrieve regular expression groups

2010-05-05 Thread OKB (not okblacke)
by collapsing my multiple regexes into one, so it's good for now. Thanks for the help. -- --OKB (not okblacke) Brendan Barnwell Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail. --author unknown __ R-help@r

[R] Retrieve regular expression groups

2010-05-02 Thread OKB (not okblacke)
in the target string. How can I get access to this matched group? All I can seem to get the various grep/gsub functions to do is return or modify the entire target string. Isn't there a way to extract ONLY the text from a particular group or groups? Thanks, -- --OKB (not okblacke) Brendan Barnwell

Re: [R] Retrieve regular expression groups

2010-05-02 Thread OKB (not okblacke)
the code of strapply itself. Also, the above code gives different results depending on whether I specify X=tmp or simply tmp as the third argument. Shouldn't these be the same, since X is the first argument of strapply? Any idea what's going on here? Thanks again, -- --OKB (not okblacke) Brendan

[R] Windows RGui line editing

2009-09-19 Thread OKB (not okblacke)
who uses R on Windows just suffer with this limitation? (The main reason I'm asking is that it seems hard for me to believe the latter is true, so I feel like I must be missing something.) Thanks, -- --OKB (not okblacke) Brendan Barnwell Do not follow where the path may lead. Go, instead, where

[R] Generalized cumsum?

2009-09-16 Thread OKB (not okblacke)
and cumprod as special cases when f=sum or f=prod. I could write such a function, but I can't see a way to do it without a loop, so I'm wondering if such a function exists that may be speedier. Thanks, -- --OKB (not okblacke) Brendan Barnwell Do not follow where the path may lead. Go

Re: [R] Generalized cumsum?

2009-09-16 Thread OKB (not okblacke)
of the vector. Thanks, -- --OKB (not okblacke) Brendan Barnwell Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail. --author unknown __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo

[R] Windows RGui line editing

2009-09-16 Thread OKB (not okblacke)
functionality? Thanks, -- --OKB (not okblacke) Brendan Barnwell Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail. --author unknown __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

Re: [R] Generalized cumsum?

2009-09-16 Thread OKB (not okblacke)
-compose transitively. For instance: Reduce(mean, c(1,2,3,4), accumulate=T) [1] 1 1 1 1 but I want cumapply(mean, c(1,2,3,4)) [1] 1 1.5 2 2.5 Is there anything this general? Thanks, -- --OKB (not okblacke) Brendan Barnwell Do not follow where the path may lead. Go, instead, where

Re: [R] Generalized cumsum?

2009-09-16 Thread OKB (not okblacke)
David Winsemius wrote: cumapply - function (FUN, X) { FUN - match.fun(FUN) answer - sapply(1:length(X), function(x) { FUN(X[1:x])} ) return(answer)} Cool, thanks. It's still interesting to me that there's no such thing built-in. Best wishes, -- --OKB (not okblacke

[R] ave returns wrong type

2009-04-15 Thread OKB (not okblacke)
of the function (as, for instance, tapply does it), not the type of the data being summarized by that function. Is this just a bug? Is there any known way to deal with this other than just manually casting the data to the type I need? Thanks, -- --OKB (not okblacke) Brendan Barnwell Do