cjvanlissa / worcs

Rstudio project template and convenience functions for the Workflow for Open Reproducible Code in Science (WORCS)
https://cjvanlissa.github.io/worcs/
GNU General Public License v3.0
76 stars 11 forks source link

Functionality: Allow users to specify which summary stats to use in the codebook #129

Open jikaczmarski opened 1 year ago

jikaczmarski commented 1 year ago

Hi there,

I've added some code to the codebook.R file that allows users to specify a string of summary statistics that they would like to appear in the codebook. I've tested that it works well and have had no issues. I do ensure that "name" and "type" are always specified, but there might be a better way to handle that.

cjvanlissa commented 1 year ago

Edit: Thank you for engaging with the package and suggesting this functionality!

However, I'm not sure about this.. can you clarify what problem this solves?

I do see potential for breaking other functionality; for example, the functionality to restore factor/ordered factor levels relies on the codebook; if this information is missing, that functionality would break.

jikaczmarski commented 1 year ago

No problem! In many cases, especially with specific kinds of data, there is no reason to list out the mode, mode_value, kurtosis, skewness, etc. This feature would allow the user to only specify what they want to show in the codebook. It provides a cleaner representation of the data.

Would you be willing to point me to the file you mention about factor/ordered factor levels? I have some ideas in mind to fix that if need be.

cjvanlissa commented 1 year ago

have a look here: https://github.com/cjvanlissa/worcs/blob/64d2f9ade150a3e1bec43acab8ed9104dec096cd/R/save_load.R#L412