DesignLibrary icon indicating copy to clipboard operation
DesignLibrary copied to clipboard

FIX (for discussion)

Open clarabicalho opened this issue 6 years ago • 1 comments

I agree there are high maintenance costs to adding fixed functionality and using quasi-quotation in all designers, but also think that there's value to (a) more flexible designer functions that will print the exact code users need and (b) providing some example of the source code for generating more flexible designers (that are not overwhelming like, say, factorial_designer). I'm happy to write vignette on that if useful. What are thoughts on using this approach with simple_two_arm_designer()?

The "fixed_two_arm" branch implements it and I think code is fairly straight forward. Allows users to substitute all parameter values in code text and change outcome and assignment column names, for example.

devtools::install_github("DeclareDesign/DesignLibrary", ref = "fixed_two_arm")
get_design_code(two_arm_designer(treatment_name = "message", outcome_name = "turnout"))

clarabicalho avatar Jan 25 '19 19:01 clarabicalho

I think you are approaching the limit of understandability for pasting strings together and eval'ing it - I would really recommend spending a little time trying alternative solutions, perhaps the glue package or the template package.

nfultz avatar Jan 25 '19 20:01 nfultz