## generate a first region - industry matrix with full count (period 1)
set.seed(31)
mat1 <- matrix(sample(0:10, 20, replace = TRUE), ncol = 4)
rownames(mat1) <- c("R1", "R2", "R3", "R4", "R5")
colnames(mat1) <- c("I1", "I2", "I3", "I4")
## generate a second region - industry matrix with full count (period 2)
mat2 <- mat1
mat2[3, 1] <- 8
## run the function
growth_list(mat1, mat2)
## generate a third region - industry matrix with full count (period 3)
mat3 <- mat2
mat3[5, 2] <- 1
## run the function
growth_list(mat1, mat2, mat3)
## generate a fourth region - industry matrix with full count (period 4)
mat4 <- mat3
mat4[5, 4] <- 1
## run the function
growth_list(mat1, mat2, mat3, mat4)
Run the code above in your browser using DataLab