Defines functions wsv.reader

Documented in wsv.reader

#' @describeIn preinstalled.readers Read a whitespace separated values file with the \code{.wsv} or \code{.txt} file extensions.
#' @importFrom utils read.table
#' @importFrom utils unzip
wsv.reader <- function(data.file, filename, variable.name)
  if (grepl('\\.zip$', filename))
    tmp.dir <- tempdir()
    tmp.path <- file.path(tmp.dir, data.file)
    file.copy(filename, tmp.path)
    unzip(filename, exdir = tmp.dir)
    filename <- file.path(tmp.dir, sub('\\.zip$', '', data.file))

                  header = config$data_loading_header),
         envir = .TargetEnv)

Try the ProjectTemplate package in your browser

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

ProjectTemplate documentation built on July 31, 2021, 5:07 p.m.