aknandi / disaggregation

R package containing methods for Bayesian disaggregation modelling
Other
21 stars 6 forks source link

Unify parameter naming conventions #83

Closed simon-smart88 closed 1 week ago

simon-smart88 commented 7 months ago

e.g. prepare_data() uses camelCase, snake_case and dot.notation

We'll need to figure out a way to provide backwards compatibility but there must be a way to handle that

simon-smart88 commented 3 months ago

Something like this:

my_func <- function(x.old = NULL, x_new = NULL, yold = NULL, y_new = 10) {
  if (!is.null(x.old) && missing(x_new)){
    x_new <- x.old
    message("x.old is now deprecated please use x_new instead")
  }
    if (!is.null(yold) && missing(y_new)){
    y_new <- yold
    message("yold is now deprecated please use y_new instead")
  }

  x_new * y_new
}

my_func(x.old = 5, yold = 2)
simon-smart88 commented 3 months ago

Various in the priors list of fit_model. This may need a different approach to the above example, and whilst we are at it, is the prior_ necessary?:

In as.disag_data: