-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have added user-defined thresholds based on #49 #52
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is okay for me. It is functional. We can discuss small details in the future (in particular my comments in the review).
|
||
# options initialization | ||
if (is.null(getOption("theil_u1_threshold"))) { | ||
set_thresholds_to_default("theil_u1_threshold") | ||
} | ||
if (is.null(getOption("theil_u2_threshold"))) { | ||
set_thresholds_to_default("theil_u2_threshold") | ||
} | ||
if (is.null(getOption("t_threshold"))) { | ||
set_thresholds_to_default("t_threshold") | ||
} | ||
if (is.null(getOption("augmented_t_threshold"))) { | ||
set_thresholds_to_default("augmented_t_threshold") | ||
} | ||
if (is.null(getOption("slope_and_drift_threshold"))) { | ||
set_thresholds_to_default("slope_and_drift_threshold") | ||
} | ||
if (is.null(getOption("eff1_threshold"))) { | ||
set_thresholds_to_default("eff1_threshold") | ||
} | ||
if (is.null(getOption("eff2_threshold"))) { | ||
set_thresholds_to_default("eff2_threshold") | ||
} | ||
if (is.null(getOption("orth1_threshold"))) { | ||
set_thresholds_to_default("orth1_threshold") | ||
} | ||
if (is.null(getOption("orth2_threshold"))) { | ||
set_thresholds_to_default("orth2_threshold") | ||
} | ||
if (is.null(getOption("autocorr_threshold"))) { | ||
set_thresholds_to_default("autocorr_threshold") | ||
} | ||
if (is.null(getOption("seas_threshold"))) { | ||
set_thresholds_to_default("seas_threshold") | ||
} | ||
if (is.null(getOption("signal_noise1_threshold"))) { | ||
set_thresholds_to_default("signal_noise1_threshold") | ||
} | ||
if (is.null(getOption("signal_noise2_threshold"))) { | ||
set_thresholds_to_default("signal_noise2_threshold") | ||
} | ||
|
||
if (is.null(getOption("jb_res_threshold"))) { | ||
set_thresholds_to_default("jb_res_threshold") | ||
} | ||
if (is.null(getOption("bp_res_threshold"))) { | ||
set_thresholds_to_default("bp_res_threshold") | ||
} | ||
if (is.null(getOption("white_res_threshold"))) { | ||
set_thresholds_to_default("white_res_threshold") | ||
} | ||
if (is.null(getOption("arch_res_threshold"))) { | ||
set_thresholds_to_default("arch_res_threshold") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not initialise all the options when the package is loaded?
R/revision_analysis.R
Outdated
#' options(list(augmented_t_threshold = c(severe = 0.005, bad = 0.01, uncertain = 0.05), | ||
#' slope_and_drift_threshold = c(severe = 0.005, bad = 0.05, uncertain = 0.10), | ||
#' theil_u2_threshold = c(uncertain = .5, bad = .7, severe = 1))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
options(list(...)))
<=> options(...)
R/revision_analysis.R
Outdated
thr = quality_thresholds$slope_and_drift, | ||
thr_res = quality_thresholds_res) | ||
thr = getOption("slope_and_drift_threshold"), | ||
thr_res = res_thresholds) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should detail each threshold individually. This will make it easier for the user to set thresholds individually.
For example:
instead of:
res_thresholds <- list(
jb = getOption("jb_res_threshold"),
bp = getOption("bp_res_threshold"),
white = getOption("white_res_threshold"),
arch = getOption("arch_res_threshold")
)
sd_test_evaluator(..., thr_res = res_thresholds)
You can write:
res_thresholds <- list(
jb = getOption("jb_res_threshold"),
bp = getOption("bp_res_threshold"),
white = getOption("white_res_threshold"),
arch = getOption("arch_res_threshold")
)
sd_test_evaluator(...,
jb = getOption("jb_res_threshold"),
bp = getOption("bp_res_threshold"),
white = getOption("white_res_threshold"),
arch = getOption("arch_res_threshold")
)
Maybe the best is to add an argument ...
to eval_test()
instead of threshold
.
No description provided.