From 8fa7f8f6ed8001186673ad056330177a3e88e6b8 Mon Sep 17 00:00:00 2001 From: Qinyun Lin Date: Fri, 9 Aug 2024 23:12:49 +0200 Subject: [PATCH] use '<-' for assignment instead of '='. for good practice --- R/test_sensitivity.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R/test_sensitivity.R b/R/test_sensitivity.R index 12a095b..399fcf6 100644 --- a/R/test_sensitivity.R +++ b/R/test_sensitivity.R @@ -131,18 +131,18 @@ test_sensitivity <- function(est_eff, ## verify results if (est_eff * beta_threshold < 0 & index == "IT") { - perc_to_change = 101 - recase = n_obs + 1 + perc_to_change <- 101 + recase <- n_obs + 1 if (to_return == "raw_output") { warning("Ignore the following elements beta_threshold, beta_threshold_verify, perc_bias_to_change,\n RIR_primary and RIR_perc in the raw_output.") } } if (abs(est_eff) > abs(beta_threshold)) { - beta_threshold_verify = perc_to_change / 100 * 0 + (1 - perc_to_change / 100) * est_eff + beta_threshold_verify <- perc_to_change / 100 * 0 + (1 - perc_to_change / 100) * est_eff } if (abs(est_eff) < abs(beta_threshold)) { - beta_threshold_verify = est_eff / (1 - perc_to_change / 100) + beta_threshold_verify <- est_eff / (1 - perc_to_change / 100) } ## compare beta_threshold_verify with beta_threshold