I need to produced several matrices based in one original.
For example:
I have the int matrix with integer positive numbers only
int <- matrix(rbinom(48,10, 0.1),nrow=6,ncol=4)
colnames(int) <- c("pr1","pr2","pr3","pr4")
rownames(int) <- c("fi1","fi2","fi3","fi4","fi5","fi6")
I need to:
- sum the columns on int matrix
- select random rows with same probability (it could be 1) of a random matrix
- distribute a random value for that given column and row
But this process must maintain the sum of rows and columns equal to original (int) matriz.
Any ideas, please?
I have no clue where to begin.