Skip to content

Commit 31de073

Browse files
fix linter issues
1 parent 6ea0450 commit 31de073

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

R/survival_score.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ h_lr_score_no_strata_no_cov <- function(
7272
assert_flag(check_rand_strat_warning)
7373

7474
# Check whether to warn about insufficient inclusion of randomization strata.
75-
give_rand_strat_warning <- (check_rand_strat_warning &&
76-
length(randomization_strata) > 0)
75+
give_rand_strat_warning <- (check_rand_strat_warning && length(randomization_strata) > 0)
7776

7877
# Standardize data set format, subset to relevant variables.
7978
df_stand <- data.frame(

R/utils.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@ h_are_factors_nested <- function(f1, f2) {
383383
#' @param randomization_strata (`character`) A character vector of names of the randomization strata variables in `df`.
384384
#' @param eps (`numeric`) A small tolerance value to determine if means are close to zero.
385385
#'
386-
#' @return `TRUE` if the means of residuals across randomization strata are within the specified tolerance, `FALSE` otherwise.
386+
#' @return `TRUE` if the means of residuals across randomization strata are within the specified tolerance,
387+
#' `FALSE` otherwise.
387388
#'
388389
#' @keywords internal
389390
h_unbiased_means_across_strata <- function(
@@ -401,11 +402,11 @@ h_unbiased_means_across_strata <- function(
401402
group_indices <- which(df$treatment == group)
402403
residuals_overall[group_indices] <- residuals_per_group[[group]]
403404
}
404-
residuals_split_by_randomization_strata <- split(
405+
resids_by_rand_strata <- split(
405406
residuals_overall,
406407
f = df[randomization_strata],
407408
drop = TRUE
408409
)
409-
residuals_means <- sapply(residuals_split_by_randomization_strata, mean)
410+
residuals_means <- sapply(resids_by_rand_strata, mean)
410411
all(abs(residuals_means) < eps)
411412
}

man/h_unbiased_means_across_strata.Rd

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-survival.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ test_that("robin_surv does give a warning if strata are not sufficiently include
783783
))
784784
})
785785

786-
test_that("robin_surv does give a warning if strata are insufficiently included in covariate adjusted stratified model", {
786+
test_that("robin_surv warns if strata are insufficiently included in covariate adjusted stratified model", {
787787
expect_snapshot(
788788
robin_surv(
789789
Surv(time, status) ~ 1 + strata(ecog) + ph.karno,

0 commit comments

Comments
 (0)