Skip to content

Commit

Permalink
last test?
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgirard committed Oct 27, 2024
1 parent 14cd601 commit 7b07c14
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions R/tidying_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,7 @@ norm_standardize <- function(data, scales, angles = octants(), instrument,
key <- instrument$Norms[[1]]
key <- key[key$Sample == sample, ]

if (length(scales) != nrow(key)) {
stop("Number of scales provided does not match the number of scales in the selected normative sample.")
}
stopifnot(length(scales) == nrow(key))

scale_data <- data[scales]
scale_names <- colnames(scale_data)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-tidying_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ test_that("norm_standardize works", {
expect_equal(round(new$X7_z, 4), c(2.0691, -1.7467, -0.8656, 1.5301, 0.0187))
expect_equal(round(new$X8_z, 4), c(0.5269, 3.0627, 3.2395, 1.8059, -0.6111))
expect_error(norm_standardize(
old, scales = 1:7, instrument = instrument("iipsc"), sample = 1
old, scales = 1:5, instrument = instrument("iipsc"), sample = 1
))
expect_equal(ncol(new), ncol(new2) + ncol(old))
})

0 comments on commit 7b07c14

Please sign in to comment.