Skip to content

Commit

Permalink
bug fix found in testing
Browse files Browse the repository at this point in the history
  • Loading branch information
joshyam-k committed Feb 13, 2024
1 parent 2297cfd commit f07940d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ jobs:
with:
extra-packages: any::covr
needs: coverage

- name: Set CRAN mirror
run: echo "options(repos = c(CRAN='https://cloud.r-project.org/'))" > ~/.Rprofile

- name: Install problem dependency
run: |
install.packages('lme4', type = 'source')
shell: Rscript {0}

- name: Test coverage
run: |
Expand Down
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ generate_mse <- function(.data,

design_mat_ls <- boot_pop_by_dom |>
map(.f = function(.x) {
dmat_lm <- model.matrix(~., .x[ ,lin_X])
dmat_glm <- model.matrix(~., .x[ ,log_X])
dmat_lm <- model.matrix(~., .x[ ,lin_X, drop = FALSE])
dmat_glm <- model.matrix(~., .x[ ,log_X, drop = FALSE])
return(list(design_mat_lm = dmat_lm,
design_mat_glm = dmat_glm))
})
Expand Down
8 changes: 5 additions & 3 deletions tests/testthat/test-saeczi.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
data(pop)
data(samp)

lin_formula <- DRYBIO_AG_TPA_live_ADJ ~ tcc16 + elev
lin_formula <- sqrtbio ~ tcc16

samp <- samp |>
mutate(sqrtbio = sqrt(DRYBIO_AG_TPA_live_ADJ))


set.seed(5)
result <- saeczi(samp,
Expand All @@ -16,8 +20,6 @@ test_that("result$res is a df", {
expect_s3_class(result$res, "data.frame")
})



test_that("correct number of rows in result data.frame", {
expect_equal(nrow(result$res), length(unique(pop$COUNTYFIPS)))
})
Expand Down

0 comments on commit f07940d

Please sign in to comment.