R/choose_input_files.R

Defines functions choose_input_files

Documented in choose_input_files

choose_input_files <- function() {
    if (!interactive()) {
        stop("The `choose_input_files` function is only available in interactive R sessions")
    }

    single_file_path <- file.choose()
    extension <- gsub('^.+\\.', '', single_file_path)
    directory <- dirname(single_file_path)

    list.files(
        path = directory,
        pattern = paste0('\\.', extension, '$'),
        full.names = TRUE
    )
}

Try the PhotoGEA package in your browser

Any scripts or data that you put into this service are public.

PhotoGEA documentation built on April 11, 2025, 5:48 p.m.