R/read_all_tsvs.R

#' Read And Parse All .tsv Files In Directory
#'
#' This function allows you to read and parse all of the raw vcx files generated by iCoder.
#' @description \code{read_all_tsvs()} reads parses a directory of .vcx coding files to
#'   to get prescreening information.
#' @param dir_path A path to a directory of .tsv files.
#' @param tidy A boolean, if tidy = FALSE this functions behaves just \code{read_tsv()}.
#' @param y_max An integer value indicating the largest y-coordinate in the data set.
#'   Used to create a cartesian y-coordinate variable.
#' @export
#' @examples
#'   \dontrun{d <- read_all_tsvs(dir_path = "experiment_name/data/tsv_files/")}

read_all_tsvs <- function(dir_path, tidy = FALSE, y_max = 2048) {
  files <- dir(path = dir_path,
               pattern = "*.tsv",
               full.names = T)
  files %>% purrr::map_df(read_tobii, tidy = tidy)
}
kemacdonald/Rtobii documentation built on May 4, 2019, 1:21 p.m.