From here on delcare_assignment is straight forward…
However I also realize that from Jasper’s other answer that blockTools might be a superior solution to take this on, but from my cursory understanding I am not sure how it plays into the DeclareDesign framework.
My questions are:
Is it bad to tackle this question the dplyr way or is there some reason should I really be using declare_step?
Is the method of creating one variable eventually going to limit my designs, and should I be using blockTools instead? If so, how would I use blockTools together with DeclareDesign?
I think your approach is fine, but I’d recommend using interaction instead of pasting text together - it plays nicer with factors. You can also just include it as a final variable in the population step
but we have some overly pedantic error checking on that kind of assignment right now.
Probably you would implement a custom assignment handler for declare_assignment - there’s lot’s of examples of custom handlers for estimators, and assignment is even easier because there’s less bookkeeping involved. If you do get it working, please consider sharing it.