Learn R Programming

ComBatFamQC (version 1.0.5)

diag_save: Export Batch Effect Diagnosis Results

Description

Save all the batch effect diagnosis results in a single Excel file or a Quarto report.

Usage

diag_save(path, result, use_quarto = TRUE)

Value

This function does not return a value. It saves the data to the specified file.

Arguments

path

The path to save the result.

result

A list derived from visual_prep() that contains datasets and statistical test results.

use_quarto

A boolean variable indicating whether to generate a Quarto report.

Examples

Run this code
if(interactive()){
  result <- visual_prep(type = "lm", features = "thickness.left.cuneus",
  batch = "manufac", covariates = "AGE", df = adni[1:100, ], mdmr = FALSE, cores = 1)
  temp_dir <- tempfile()
  dir.create(temp_dir)
  diag_save(temp_dir, result, quarto = FALSE)
  message("Diagnostics saved to: ", temp_dir)
  unlink(temp_dir, recursive = TRUE)  # Clean up the temporary directory
}
# \dontshow{
# Ensure temp_dir exists before attempting cleanup
if (exists("temp_dir")) unlink(temp_dir, recursive = TRUE)
# }

Run the code above in your browser using DataLab