R/read_csv_euid.R

#' Read csv file with euid column
#' 
#' @param file Dateset in csv.format
#' @return The dataset with good shape of 'euid' columns

read_csv_euid <- function(file){

  x <- read.csv(file, header = T, sep = ";", nrows = 1)
  x[, grepl('euid|name', colnames(x))] <- 'character'
  y <- sapply(x, class)
  return(read.csv(file, header = T, sep = ";", colClasses = y))
}
Nicolabo/PERUanalytics documentation built on May 7, 2019, 6:18 p.m.