tests/testthat/test-roxytest-testexamples-ezcox.R

# Generated by roxytest: Do not edit by hand!

context("File R/ezcox.R: @testexamples")

test_that("Function ezcox() @ L62", {
  
  library(survival)
  
  # Build unvariable models
  t1 <- ezcox(lung, covariates = c("age", "sex", "ph.ecog"))
  t1
  
  # Build multi-variable models
  # Control variable 'age'
  t2 <- ezcox(lung, covariates = c("sex", "ph.ecog"), controls = "age")
  t2
  
  # Return models
  t3 <- ezcox(lung,
    covariates = c("age", "sex", "ph.ecog"),
    return_models = TRUE
  )
  t3
  t4 <- ezcox(lung,
    covariates = c("sex", "ph.ecog"), controls = "age",
    return_models = TRUE
  )
  t4
  expect_s3_class(t1, "ezcox")
  expect_s3_class(t2, "ezcox")
  expect_s3_class(t3, "ezcox")
  expect_s3_class(t4, "ezcox")
})

Try the ezcox package in your browser

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

ezcox documentation built on May 31, 2023, 7:49 p.m.