Hi,
that should do:
mat <- rbind(c(20,200,100,50,100,30),
c(100,200,100,50,100,30),
c(50,200,100,50,100,30))
rownames(mat) <- c("2016-11","2016-12","2017-01")
t(apply(mat,1,cumsum))
Best,
Christian
Am 18.11.2016 um 16:16 schrieb Matthias Weber:
Hello together,
is it possible, to summing up a
, 2016 9:16 AM
To: 'r-help@r-project.org'
Subject: [R] summing up a matrix
Hello together,
is it possible, to summing up a matrix?
I have the following matrix at the moment:
[,1] [,2] [,3][,4]
[,5] [,6]
2016-11
Dear Matthias
It is rather hard to read that since you posted in HTML which scrambles
things but I think
?cumsum
may help and possibly
?apply
as you seem to want to work by rows.
On 18/11/2016 15:16, Matthias Weber wrote:
Hello together,
is it possible, to summing up a matrix?
I have the
Hello together,
is it possible, to summing up a matrix?
I have the following matrix at the moment:
[,1] [,2] [,3][,4]
[,5] [,6]
2016-1120200100 50 100
30
2016-12
4 matches
Mail list logo