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

Attempt to fix wave number issue. #15

Merged
merged 1 commit into from
Jun 16, 2023

Conversation

tjmckinley
Copy link
Contributor

This is still causing an error:

wave <- NULL
  out_list <- list()
  for (i in ifelse(zero_in, 0, 1):(length(waves)-ifelse(zero_in, 1, 0))) {
    if (i %in% wave_numbers)
      out_list[[i+1]] <- setNames(
        cbind(waves[[i+1]][,input_names],
              rep(i, nrow(waves[[i+1]]))), c(input_names, 'wave'))
  }

If you set zero_in = FALSE and then add wave numbers up to the number of waves you have then you can't access wave[[i + 1]] since it doesn't exist e.g. if I have waves 1-10, and I set zero_in = FALSE and waves = 1:10, then it errors since it tries to access waves[[11]], which doesn't exist.

This is an attempt to fix this!

Cheers,

T

@andy-iskauskas andy-iskauskas merged commit 4ca1204 into andy-iskauskas:master Jun 16, 2023
7 checks passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants