Skip to content

Commit 5c68851

Browse files
lintr fix
1 parent 1f5c23d commit 5c68851

3 files changed

Lines changed: 18 additions & 17 deletions

File tree

.lintr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ linters: linters_with_defaults(
33
commented_code_linter = NULL,
44
whitespace_linter = NULL,
55
indentation_linter = NULL,
6+
return_linter = NULL,
67
object_name_linter= NULL) # see vignette("lintr")
78
encoding: "UTF-8"
89
exclusions: list(

tests/testthat/test-constructAdjacency.R

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ test_that("computeParentAdjacency matches across all methods for additive compon
1616
verbose = FALSE, lastComputed = 0, checkpoint_files = checkpoint_files,
1717
update_rate = 10, parList = init_list, lens = init_lens, save_rate_parlist = 20,
1818
config = config
19-
) %>%
20-
as.data.frame() %>% # sort by iss and jss to ensure consistent ordering
19+
) |>
20+
as.data.frame() |> # sort by iss and jss to ensure consistent ordering
2121
dplyr::arrange(iss, jss)
2222

2323
adj_indexed <- computeParentAdjacency(
@@ -26,8 +26,8 @@ test_that("computeParentAdjacency matches across all methods for additive compon
2626
verbose = FALSE, lastComputed = 0, checkpoint_files = checkpoint_files,
2727
update_rate = 10, parList = init_list, lens = init_lens, save_rate_parlist = 20,
2828
config = config
29-
) %>%
30-
as.data.frame() %>% # sort by iss and jss to ensure consistent ordering
29+
) |>
30+
as.data.frame() |> # sort by iss and jss to ensure consistent ordering
3131
dplyr::arrange(iss, jss)
3232

3333
adj_direct <- computeParentAdjacency(
@@ -36,8 +36,8 @@ test_that("computeParentAdjacency matches across all methods for additive compon
3636
verbose = FALSE, lastComputed = 0, checkpoint_files = checkpoint_files,
3737
update_rate = 10, parList = init_list, lens = init_lens, save_rate_parlist = 20,
3838
config = config
39-
) %>%
40-
as.data.frame() %>% # sort by iss and jss to ensure consistent ordering
39+
) |>
40+
as.data.frame() |> # sort by iss and jss to ensure consistent ordering
4141
dplyr::arrange(iss, jss)
4242

4343
expect_equal(adj_loop, adj_indexed, tolerance = tolerance)
@@ -55,17 +55,17 @@ test_that("adjBeta matches .adjDirect for common nuclear component", {
5555
parList = NULL, lens = NULL, lastComputed = 0, saveable = FALSE, resume = FALSE,
5656
save_path = NULL, verbose = FALSE, save_rate_parlist = NULL, update_rate = NULL,
5757
checkpoint_files = NULL, config = config
58-
) %>%
59-
as.data.frame() %>% # sort by iss and jss to ensure consistent ordering
58+
) |>
59+
as.data.frame() |> # sort by iss and jss to ensure consistent ordering
6060
dplyr::arrange(iss, jss)
6161

6262
direct <- .adjDirect(
6363
ped = hazard, component = "common nuclear", saveable = FALSE, resume = FALSE,
6464
save_path = NULL, verbose = FALSE, lastComputed = 0, checkpoint_files = NULL,
6565
update_rate = NULL, parList = NULL, lens = NULL, save_rate_parlist = NULL,
6666
config = config
67-
) %>%
68-
as.data.frame() %>% # sort by iss and jss to ensure consistent ordering
67+
) |>
68+
as.data.frame() |> # sort by iss and jss to ensure consistent ordering
6969
dplyr::arrange(iss, jss)
7070

7171
expect_equal(beta_5, direct, tolerance = tolerance)

tests/testthat/test-simulatePedigree.R

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ test_that("simulated pedigree generates expected data structure", {
44
kpc <- 4
55
sexR <- .50
66
marR <- .7
7-
beta_options <- c(F, T)
7+
beta_options <- c(FALSE, TRUE)
88
strict_tolerance <- 1e-8
99
sex_tolerance <- .035
1010
base_length <- 57
@@ -49,7 +49,7 @@ test_that("simulated pedigree generates expected data structure when sexR is imb
4949
kpc <- 4
5050
sexR <- .55
5151
marR <- .7
52-
beta_options <- c(F, T)
52+
beta_options <- c(FALSE, TRUE)
5353
strict_tolerance <- 1e-8
5454
sex_tolerance <- .03
5555
base_length <- 154
@@ -96,7 +96,7 @@ test_that("simulated pedigree generates expected data structure when sexR is imb
9696
kpc <- 4
9797
sexR <- .45
9898
marR <- .7
99-
beta_options <- c(F, T)
99+
beta_options <- c(FALSE, TRUE)
100100
strict_tolerance <- 1e-8
101101
sex_tolerance <- .03
102102
# Optimized version needs wider tolerance for sex ratios on large pedigrees
@@ -158,11 +158,11 @@ test_that("simulated pedigree generates expected data structure but supply var n
158158
code_male <- "M"
159159
code_female <- "Fe"
160160
personID <- "Id"
161-
beta_options <- c(F, T)
161+
beta_options <- c(FALSE, TRUE)
162162
strict_tolerance <- 1e-8
163163
sex_tolerance <- .03
164164
sex_tolerance_opt <- .07
165-
# beta_options <- T
165+
# beta_options <- TRUE
166166
base_length <- 57
167167
base_length_tol <- 0.2 * base_length
168168
beta_match_base <- FALSE
@@ -221,9 +221,9 @@ test_that("simulatePedigree verbose prints updates", {
221221
kpc <- 4
222222
sexR <- .50
223223
marR <- .7
224-
beta_options <- c(F, T)
224+
beta_options <- c(FALSE, TRUE)
225225

226-
# beta_options <- T
226+
# beta_options <- TRUE
227227
for (beta in beta_options) {
228228
set.seed(seed)
229229
message("Beta option Starting: ", beta)

0 commit comments

Comments
 (0)