Conversation
Added an additional argument to make_codebook() called stats. If this argument is not called, then the codebook will generate all 18 variables as previously designed. If the user enters a string of stats (e.g., stats = "n missing mean median sd min max"), then the summary stats will be limited only to those but will also include the name and type of the variable. The following stats may be specified: n, missing, unique, mean, median, mode, mode_value, sd, v, min, max, range, skew, skew_2se, kurt, kurt_2se
Fixed logic condition.
|
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. |
|
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. |
|
have a look here: Line 412 in 64d2f9a |
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.