Skip to content

iterate() should unlist arguments before passing to popfun #9

@atyre2

Description

@atyre2
# 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions