## 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_mat(mat1, mat2)
Run the code above in your browser using DataLab