age_save: Export Brain ROI Age Trends

View source: R/Help_Func.R

age_saveR Documentation

Export Brain ROI Age Trends

Description

Save all brain age trends into a single Excel file.

Usage

age_save(path, age_list)

Arguments

path

The path to save the excel file.

age_list

A list containing all ROIs' true volumes, age trend estimates, and the fitted GAMLSS model.

Value

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

Examples

if(interactive()){
sub_df <- age_df[,c("Volume_1", "age", "sex", "ICV_baseline")] |> na.omit()
colnames(sub_df) <- c("Volume_1", "age", "sex", "icv")
age_list <- list("Volume_1" = age_list_gen(sub_df = sub_df))

temp_dir <- tempfile()
dir.create(temp_dir)
age_save(temp_dir, age_list)
message("Age trend table saved to: ", temp_dir)
unlink(temp_dir, recursive = TRUE)
}


ComBatFamQC documentation built on April 4, 2025, 12:24 a.m.