andy-iskauskas / hmer

An R package for Bayes Linear emulation and history matching.
Other
16 stars 3 forks source link

Attempt to fix wave number issue. #15

Closed tjmckinley closed 1 year ago

tjmckinley commented 1 year ago

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