diff --git a/R/requireCohortIntersect.R b/R/requireCohortIntersect.R index ff5c68c..510f20c 100644 --- a/R/requireCohortIntersect.R +++ b/R/requireCohortIntersect.R @@ -105,7 +105,7 @@ requireCohortIntersect <- function(cohort, ) | (!.data$cohort_definition_id %in% .env$cohortId) ) |> - dplyr::select(cols) |> + dplyr::select(dplyr::all_of(cols)) |> dplyr::compute(name = subsetName, temporary = FALSE) # attrition reason diff --git a/tests/testthat/test-requireConceptIntersect.R b/tests/testthat/test-requireConceptIntersect.R index f9298ea..0266069 100644 --- a/tests/testthat/test-requireConceptIntersect.R +++ b/tests/testthat/test-requireConceptIntersect.R @@ -96,7 +96,7 @@ test_that("require flag in concept", { # only support one concept at the moment expect_error( requireConceptIntersect(cohort = cdm$cohort1, - conceptSet = list(a = 1, b = 2), + conceptSet = list(a = 1L, b = 2L), window = c(-Inf, Inf)) ) expect_error( diff --git a/tests/testthat/test-requireDemographics.R b/tests/testthat/test-requireDemographics.R index eebd483..d884237 100644 --- a/tests/testthat/test-requireDemographics.R +++ b/tests/testthat/test-requireDemographics.R @@ -436,7 +436,7 @@ test_that("codelist kept with >1 requirement", { cdm <- cdm_local |> copyCdm() - cdm$cohort1 <- conceptCohort(cdm = cdm, conceptSet = list(a = 1, b = 2), name = "cohort1") + cdm$cohort1 <- conceptCohort(cdm = cdm, conceptSet = list(a = 1L, b = 2L), name = "cohort1") cdm$cohort2 <- cdm$cohort1 |> requireDemographics(name = "cohort2", minPriorObservation = c(0,3), cohortId = 1) expect_equal(attr(cdm$cohort2, "cohort_codelist") |> dplyr::collect() |> dplyr::arrange(.data$cohort_definition_id), dplyr::tibble(