# create the projection matrix
A <- matrix(c(0, 0, 1,
0.75, 0, 0,
0, 0.9, 0.9), nrow = 3, byrow = TRUE)
# store it in the tibble as a replicated list
inputs <- tibble(t = 1:20,
A = rep(list(A), 20))
# create the one line function
project_matrix <- function(N0, A){
# need to add [[1]] to "unlist" A
A[[1]] %*% N0 # matrix multiply and return result
}
head(iterate(inputs, N0 = c(1,1,1), project_matrix))
Shouldn't have to use [[1]] after A in the popfun
Shouldn't have to use [[1]] after A in the popfun