tests/testthat/test_cohort_shell.R

library(psHarmonize)

# Creating some test data -------------

# Introducing incorrect idvar value
error_sheet <- harmonization_sheet_example
error_sheet[3,c('id_var')] <- 'id_var'

test_that(desc = 'Testing cohort shell function',
          {
            expect_message(object = cohort_shell_func(error_sheet), regexp = 'id_var: id_var in dataset: cohort_a not found')
          })

Try the psHarmonize package in your browser

Any scripts or data that you put into this service are public.

psHarmonize documentation built on April 4, 2025, 1:50 a.m.