## generate a technology - patent matrix
set.seed(31)
mat <- matrix(sample(0:1, 30, replace = TRUE), ncol = 5)
rownames(mat) <- c("T1", "T2", "T3", "T4", "T5", "T6")
colnames(mat) <- c("US1", "US2", "US3", "US4", "US5")
## generate a technology - patent sparse matrix
library(Matrix)
smat <- Matrix(mat, sparse = TRUE)
## run the function
ease_recombination(mat)
ease_recombination(smat, sparse = TRUE)
## generate a regular data frame (list)
my_list <- get_list(mat)
## run the function
ease_recombination(my_list, list = TRUE)
Run the code above in your browser using DataLab