R/group_files.R

Defines functions group_files

Documented in group_files

#' Group files for windows
#'
#' @return
#' @export
#'
#' @examples
group_files <- function(){
  
  pathPrep <- function(path = "clipboard") {
    y <- if (path == "clipboard") {
      readClipboard()
    } else {
      cat("Please enter the path:\n\n")
      readline()
    }
    x <- chartr("\\", "/", y)
    writeClipboard(x)
    return(x)
  }
  
  folder <- enquo(pathPrep())
  
  files <- list.files(folder, full.names = TRUE)
  
  read <- bind_rows(map(files, read_tsv, col_names = FALSE))
  
  write_tsv(read, path = paste0(folder, "/g4r.txt"), col_names = FALSE)
  

}
brentscott93/biophysr documentation built on Sept. 14, 2021, 2:35 a.m.