R/switchread.R

Defines functions switchread

library(tools)
#' @param expr A variable in the dataframe
#'
#' @return A dataframe
#' @import tools
#' @import utils
#' @export

switchread=function(x){
  switch(file_ext(x),
         sav=readasav(x),
         xlsx=readaexcel(x),
         xls=readhtml(x),
         csv=readacsv(x),
         print(paste("Cannot identify the file type:", x)))
}
songssssss/cleanbot documentation built on Dec. 23, 2021, 3:33 a.m.