DeclareDesign / DesignLibrary

Library of Research Designs
https://declaredesign.org/library/
Other
30 stars 3 forks source link

FIX (for discussion) #221

Open clarabicalho opened 5 years ago

clarabicalho commented 5 years ago

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"))
nfultz commented 5 years ago

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.