read_csvs_folder: Read all CSV peak files in a folder

read_csvs_folderR Documentation

Read all CSV peak files in a folder

Description

Lists CSV files in a folder and reads them into a named list of data frames.

Usage

read_csvs_folder(foldername, verbose = TRUE, ...)

Arguments

foldername

Path to the folder containing CSV files.

verbose

Logical; whether progress messages should be shown.

...

Additional arguments passed to read.csv().

Value

A named list of data frames, one per CSV file found in the folder.

Examples

folder <- file.path(tempdir(), "peak_csvs")
dir.create(folder, showWarnings = FALSE)
utils::write.csv(data.frame(ppm = c(1, 2), int = c(10, 20)),
                 file.path(folder, "sample1.csv"), row.names = FALSE)
utils::write.csv(data.frame(ppm = c(1, 3), int = c(15, 30)),
                 file.path(folder, "sample2.csv"), row.names = FALSE)
read_csvs_folder(folder, verbose = FALSE)


specmine documentation built on Aug. 5, 2026, 5:06 p.m.