cimentadaj/DDSQLtools

Seems that many of the `do` functions have repetitive code that can be reused

cimentadaj opened this issue · 2 comments

Seems that many of the `do` functions have repetitive code that can be reused

For example, they all call

  input <- as.list(environment())
  arg_names <- c(names(input), names(list(...)))

in the beginning. However, this is only used for printing the verbose options. Perhaps a smaller functions that picks up the values of the parent environment can detect these and this can be integrated into controlOutputMsg2.

Moreover, all functions have a very similar gather and mutate call which can be recycled. This is a bit similar to #5 in harmonizing the code.

I've already removed all gather and mutate calls in most cases, but it seems that the code in within can perhaps be recycled across functions. This can be generalized once I find out if all Age related columns can be filled out (seems that in some functions it's filled but in others it's not, see #5).