tests/testthat/test_risk_factor.R

test_that("Generate risk fastors",{
  
  covar <- risk_factor(ukb.data=covid_example("sim_ukb.tab.gz"),
                       ABO.data=covid_example("sim_covid19_misc.txt.gz"),
                       hesin.file=covid_example("sim_hesin.txt.gz"),
                       res.eng=covid_example("sim_result_england.txt.gz"))
  
  expect_s3_class( covar, "data.frame" )
  expect_equal( colnames(covar), c("ID", "sex", "age", "bmi", "ethnic", "other.ppl", "black", "asian", "mixed", "white", "SES", "smoke", "blood_group", "O", "AB", "B", "A", "inAgedCare"))
  
})

Try the UKB.COVID19 package in your browser

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

UKB.COVID19 documentation built on March 18, 2022, 8:03 p.m.