[R] Using paste to create and evaluate a variable expression

2012-09-17 Thread Bryan Keller
Is it possible to use paste to write out an expression and evaluate it? Suppose I want to add two vectors X1 and X2, defined as follows: X1 - 1:6 X2 - 6:1 If I write the following it looks like what I want but is a character: noquote(paste(paste(X, 1, sep = ), paste(X, 2, sep = ), sep = +)) Is

Re: [R] Using paste to create and evaluate a variable expression

2012-09-17 Thread Bryan Keller
This is perfect, thanks! On Mon, Sep 17, 2012 at 7:16 AM, arun smartpink...@yahoo.com wrote: Hi, Try this: expr1-parse(text=paste(paste0(X,1:2),collapse=+)) eval(expr1) #[1] 7 7 7 7 7 7 A.K. - Original Message - From: Bryan Keller bsbkel...@gmail.com To: r-help@r

Re: [R] Question about package coin

2010-05-30 Thread Bryan Keller
, 29 May 2010, Bryan Keller wrote: Anyone know if coin can run a permutation test based on a (user-defined) statistic other than the mean difference?  The function independence_test does the permutation t-test via difference in means. ...by default, that is. I'm wondering if it's possible

[R] Question about package coin

2010-05-29 Thread Bryan Keller
or objects which can be retrieved from coin output. Bryan --- Bryan Keller, Doctoral Student/Project Assistant Educational Psychology - Quantitative Methods The University of Wisconsin - Madison __ R-help@r-project.org mailing list https

[R] Permutation tests using apply function with package coin

2010-04-26 Thread Bryan Keller
is that turning each column into a data frame is what slows coin down. Any ideas on how to tune this up would be most appreciated. Bryan --- Bryan Keller, Doctoral Student/Project Assistant Educational Psychology - Quantitative Methods The University of Wisconsin - Madison

Re: [R] Combine vectors in order to form matrixes with combn

2009-09-21 Thread Bryan Keller
Moreno, I don't understand exactly what it is you are trying to do. Can you explain what you want your matrices to look like? Perhaps give an example. Bryan - Bryan Keller, Doctoral Student/Project Assistant Educational Psychology - Quantitative Methods The University

Re: [R] generating unordered combinations

2009-09-18 Thread Bryan Keller
/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. - Bryan Keller, Doctoral Student/Project Assistant Educational Psychology - Quantitative Methods The University

Re: [R] wilcox.test p-value = 0

2009-09-16 Thread Bryan Keller
...@u.washington.eduUniversity of Washington, Seattle -- - Bryan Keller, Doctoral Student/Project Assistant Educational Psychology - Quantitative Methods The University of Wisconsin - Madison __ R-help@r-project.org

[R] How to quickly find the position of the first non-zero element of a vector

2009-09-15 Thread Bryan Keller
Or, might the fastest way be to choose between the two methods on-the-fly based on length of the vector, etc.? Bryan - Bryan Keller, Doctoral Student/Project Assistant Educational Psychology - Quantitative Methods The University of Wisconsin - Madison

[R] Slow enumeration of vectors with restrictions

2009-09-11 Thread Bryan Keller
] } } R } T - rev(sort(T)) m - as.integer(m) offset - sum(T[-1]) - m + 1L nrow - length(T) - 1L memo - matrix(rep(NA_real_, nrow * (offset + m)), nrow=nrow) C(length(T), m) } #end of function A - Bryan Keller, Doctoral Student/Project Assistant

[R] Recursion is slow

2009-09-03 Thread Bryan Keller
) { if (0 = m m = T[1]) { return(1) } else { return(0) } } R - 0 for (u in 0:T[lt]) { R - (R+(A(T[1:(lt-1)],(m-u } return(R) } - Bryan Keller, Doctoral Student/Project Assistant Educational Psychology

Re: [R] Recursion is slow

2009-09-03 Thread Bryan Keller
. Bryan - Bryan Keller, Doctoral Student/Project Assistant Educational Psychology - Quantitative Methods The University of Wisconsin - Madison - Original Message - From: William Dunlap wdun...@tibco.com Date: Thursday, September 3, 2009 6:41 pm Subject: RE: [R] Recursion is slow