You mean like cumsum()?
> a<-1:10
> b<-cumsum(a)
> b
[1] 1 3 6 10 15 21 28 36 45 55
-Nick Larson
--
View this message in context:
http://r.789695.n4.nabble.com/code-for-permutative-operation-tp3354839p3354849.html
Sent from the R help mailing list archive at Nabble.com.
__
On Mar 14, 2011, at 4:16 PM, Sascha Vieweg wrote:
On 11-03-14 21:09, David Winsemius wrote:
On Mar 14, 2011, at 3:52 PM, Sascha Vieweg wrote:
Hello, I need some form of a "permutative" operation on a numeric
vector x
x = (v1, v2, v3, ..., vN)
that produces
x.r = (v1, v1+2, v1+v2+v3, ... v
On 11-03-14 21:09, David Winsemius wrote:
On Mar 14, 2011, at 3:52 PM, Sascha Vieweg wrote:
Hello, I need some form of a "permutative" operation on a numeric vector x
x = (v1, v2, v3, ..., vN)
that produces
x.r = (v1, v1+2, v1+v2+v3, ... v1+v2+...+vN)
If the operation is sum() I can run
x
On Mar 14, 2011, at 3:52 PM, Sascha Vieweg wrote:
Hello, I need some form of a "permutative" operation on a numeric
vector x
x = (v1, v2, v3, ..., vN)
that produces
x.r = (v1, v1+2, v1+v2+v3, ... v1+v2+...+vN)
If the operation is sum() I can run
x <- 5:8
m <- matrix(rep(x, length(x)), nc
Hello, I need some form of a "permutative" operation on a numeric
vector x
x = (v1, v2, v3, ..., vN)
that produces
x.r = (v1, v1+2, v1+v2+v3, ... v1+v2+...+vN)
If the operation is sum() I can run
x <- 5:8
m <- matrix(rep(x, length(x)), ncol=length(x))
(x.r <- rowsum(m * upper.tri(m, diag=TRU
5 matches
Mail list logo