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
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
, 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
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
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
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
/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
...@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
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
}
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
) {
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
.
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
12 matches
Mail list logo