I created a list which contains 105 matrices as follows:
m<-vector("list",105)
for (i in 2:105) {
m[[i-1]]<-Datos[(x[i-1]+1):x[i],1:14] }
m[[105]]<-Datos[(x[105]+1):533195,1:14]
For example a part of my matrix number 104 returns (In columns):
m[[104]]
ID:
8866
8866
8866
8866
8866
8866
8866
8866
Date:
1990-4-15
1990-4-16
1990-4-17
1990-4-18
1990-4-15
1990-4-16
1990-4-17
1990-4-18
Series:
APV
APV
APV
APV
INV
INV
INV
INV
These are some of my columns of the matrix. What I would like is to split this matrix using the series columns. I think it would be like a list of a list depending of the number of different Series there are. In this case there are 2: APV and INV ( Note that I don’t know the names of the series for each matrix, so there must be a function that extract the unique different series)
In summary, I would like that:
m[[104]][[1]] returns:
ID:
8866
8866
8866
8866
Date:
1990-4-15
1990-4-16
1990-4-17
1990-4-18
Series:
APV
APV
APV
APV
And m[[104]][[2]] returns:
ID:
8866
8866
8866
8866
Date:
1990-4-15
1990-4-16
1990-4-17
1990-4-18
Series:
INV
INV
INV
INV
Or maybe you come up with a more efficient way to do this.
PD: Didn’t know how to put the columns at the same level
Try this:
or: