Skip to contents

This function searches a directory for .rds files, each presumably containing one or more rows of simulation results, then merges them into a single data frame. Each row includes a file column indicating the source file path.

Usage

read_all_results(result_dir = "results")

Arguments

result_dir

A character string specifying the directory to look for .rds files. Defaults to "results".

Value

A combined data.frame with rows from all loaded files, including a file column.

Details

If no files are found, the function raises an error. Otherwise, each file is read with readRDS and merged using dplyr::bind_rows, which safely handles heterogeneous column structures by filling missing columns with NA.

Examples

if (FALSE) { # \dontrun{
df <- read_all_results("results")
head(df)
} # }