Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
atyre2 opened this issue Jul 16, 2019 · 0 comments
Open

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

atyre2 opened this issue Jul 16, 2019 · 0 comments

Comments

@atyre2
Copy link
Owner

atyre2 commented Jul 16, 2019

# 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant