Skip to content

Commit

Permalink
type: <misc> message: <minor changes>
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmoy28 committed Nov 17, 2023
1 parent e8c6c68 commit e1f43f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Version: 0.1.1
Date: 2023-11-04 20:22:05 UTC
SHA: 8b4e1e8f3cbd61aa241f584d4c593c9165b0f73b
6 changes: 3 additions & 3 deletions tests/testthat/test-centering.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ testthat::test_that('center_grand_mean', code = {
test_df = tibble::tibble(x = 1:5, y = 10:14)
centered_df = center_grand_mean(test_df,cols = everything())
for (i in 1:length(centered_df$x)) {
expect_equal(centered_df$x_grand_c[i], test_df$x[i] - mean(test_df$x))
expect_equal(centered_df$x_c[i], test_df$x[i] - mean(test_df$x))
}

for (i in 1:length(centered_df$y)) {
expect_equal(centered_df$y_grand_c[i], test_df$y[i] - mean(test_df$y))
expect_equal(centered_df$y_c[i], test_df$y[i] - mean(test_df$y))
}
})

testthat::test_that('z_scored_grand_mean', code = {
centered_col = z_scored_grand_mean(iris,cols = 'Sepal.Length') %>% dplyr::pull('Sepal.Length_grand_z')
centered_col = z_scored_grand_mean(iris,cols = 'Sepal.Length') %>% dplyr::pull('Sepal.Length_z')
check_centered_col = scale(iris$Sepal.Length, center = TRUE,scale = TRUE) %>% as.numeric()
testthat::expect_equal(centered_col,check_centered_col)
})
Expand Down

0 comments on commit e1f43f0

Please sign in to comment.