insightsengineering / insightsengineering/chevron
readme for developers
- Dominant language
- R
- Stars
- 19
- Forks
- 1
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
to make chevron executable in scripts with arguments, we need to make sure
1. the argument type should be one of the following types: `logical`, `character`, `numeric`, or (named nested) list of them
2. vectors should not be named. list must be named. vector or list should not contain mixed data type
3. `match.arg` can be used now.
4. all pre functions should use `::` to explicitly call functions, unless it is already called through "library" in script
6. if reformatting is needed, reuse standard rules/create standard rule in `dunlin` (currently in chevron we create standard rules).
7. In preprocessing, make assumptions on data input **loose**! there can be uncleaned data. factors/characters are possible
8. arguments should not be too much!
9. `pre` function should have very straightforward derivations for users to understand.
1. ultimate responsibility goes to the end user for pre functions
2. pre function, should contain basic derivations using dplyr/base R
3. reformatting should be explicit (in mutate calls, use `reformat(xxx, xxx)`, instead of using `reformat.list` method
4. labels and variable derivation best in one place
5. basic filtering `anl01fl = "Y"` can be added here
6. filtering for `PARAMCD`, depends on if we would like to use it as a suffix.
10. `main` function do use the variable derived from `pre`
1. make it an argument if it can be modified by user
2. (not sure) do not make it an argument if it should not be modified by user (e.g., EVENT = CNSR != 1)
3. labels, use the variable labels, instead of creating a new argument(too much argument makes it difficult to read!)
1. Add README.md!
2. Add unit tests!
3. unit tests should use `cat(export_as_txt(...))` to make sure the output is good
4. Assumptions on data
5. adsl, under no circumstances, can be empty (there will not be outputs filter adsl to empty!)
6. other datasets, could be empty
1. avoid trim_rows as much as possible!
2. it created table possibly not paginatable
3. page_var need to be considered!
4. whether to split by paramcd need to be considered!
Release related:
1. tag on feature branch, not main
2. submit package to autovalidator through hash or tag
5. merge main after check passes
Contributor guide
Assessment
This issue has not been assessed yet.