# \donttest{
# Prepare example data files
pheno_data <- data.frame(
IID = paste0("ID", 1:100),
time = rexp(100, 0.1),
status = rbinom(100, 1, 0.3)
)
covar_data <- data.frame(
IID = paste0("ID", 1:100),
age = rnorm(100, 50, 10),
sex = rbinom(100, 1, 0.5)
)
# Use temporary directory for file operations to comply with CRAN policies
temp_dir <- tempdir()
pheno_file <- file.path(temp_dir, "phenotype.csv")
covar_file <- file.path(temp_dir, "covariates.csv")
output_file <- file.path(temp_dir, "null_model.rds")
write.csv(pheno_data, pheno_file, row.names = FALSE)
write.csv(covar_data, covar_file, row.names = FALSE)
# Step 2: Fit null Cox model from files
fit_cox_model_from_files(
phenotype_file = pheno_file,
covariate_file = covar_file,
output_file = output_file
)
# Load the fitted model for Step 3
model_info <- readRDS(output_file)
# }
Run the code above in your browser using DataLab