R/get_bioanalyzer_results_paths.R

Defines functions get_bioanalyzer_results_paths

Documented in get_bioanalyzer_results_paths

#' Get paths of bioanalyzer results
#'
#'get_bioanalyzer_results_paths() looks for the paths to Results.csv files generated by bioanalyzer.
#'
#' @param main_path path to main directory from which the search should start.
#'
#' @return A list containing the paths to Results.csv files.
#'
#' @export
#'
#' @examples
#'
get_bioanalyzer_results_paths <- function(main_path) {

  dir_list <- dir(main_path)

  results_file_list <- lapply(X = dir_list,
                              FUN = function(x) { paste0(main_path,
                                                         x,
                                                         "/",
                                                         list.files(paste0(main_path, x), pattern = "^.*Results.csv$")) })
  names(results_file_list) <- dir_list

  results_file_list

}
benvallin/banban documentation built on Sept. 29, 2023, 5:46 a.m.