phac-nml-phrsd / wem

Wastewater Epidemic Model
MIT License
14 stars 2 forks source link

Catch potential issue #25

Open davidchampredon opened 2 years ago

davidchampredon commented 2 years ago

in fcst.R in function remove.fut.inference(): add this piece of code after idx.v = which(names(prm)==nm.v) to improve robustness. Also check other potential issues:

 if(length(idx.v)>1){
      msg = paste0('From `remove.fut.inference()`:\n the parameter `',
                   names(prm)[idx.v][1], 
                   '` is defined multiple times. Ambiguous! Stopping.')
      stop(msg)
    }