milanwiedemann / suddengains

An R package for identifying sudden gains in longitudinal data
https://milanwiedemann.github.io/suddengains/
Other
7 stars 0 forks source link

add more specific error messages to all functions #5

Closed milanwiedemann closed 5 years ago

milanwiedemann commented 5 years ago

Ideas from Graham

Errors: Argument [name] missing Error in sg_pre_post_var_list - 6 variables must be specified No Sudden gains/losses calculable using 'method = pattern' (too much missing data) sg_crit1_cutoff should be negative to identify sudden losses. Variable ["name"] not found

Variable "id" contains duplicate values. Warnings: sg_crit1_cutoff set to 0: Crit1 not applied sg_crit2_pct set to 0: Crit 2 not applied sg_crit3 set to [FALSE/0/NULL]: Crit 3 not applied Should we have something about identify_sg_1to2 = TRUE to indicate that assessment data is required?

Errors:

sg_crit1_cutoff is set to a negative value. To identify sudden losses use 'identify = sl'.

tx_start_var_name and tx_end_var_name cannot be identical. tx_start_var_name and tx_end_var_name must both be present in sg_var_list. If method = min_sess, argument min_sess_num is required.

milanwiedemann commented 5 years ago

there NEEDs to be a proper error message for when no sudden gain / loss can be identified! at the moment all sorts of funny things get returned but its not helpful at all

milanwiedemann commented 5 years ago

most of these implemented! adding new issues with specific error messages that need to be added