Skip to contents

Searches a specified folder for files related to RosyREDCap projects and returns their file paths. Optionally validates the folder to ensure it was previously set up using `setup_DB()`.

Usage

check_folder_for_projects(file_path, validate = T)

Arguments

file_path

Character. The path to the folder to search.

validate

Logical. If `TRUE`, the function will only accept valid directories previously set up with `setup_DB()`. Default is `TRUE`.

Value

A character vector of file paths for valid RosyREDCap project files in the folder. Returns an empty character vector if no valid files are found.

Details

This function checks a folder (and optionally validates its setup) for `.RData` files that correspond to RosyREDCap projects. It identifies files with the extension `.RData` and names ending in `_RosyREDCap`, filtering out any unrelated files.

See also

setup_DB for setting up valid directories.