R/read_csv_filename.r

Defines functions read_csv_filename

Documented in read_csv_filename

#' Imports a CSV file and attaches the file path as a column.
#'
#' @param filename file path
#'
#' @return a dataframe
#'
#' @export

read_csv_filename <- function(filename){
  mycsv <- read.csv(filename, sep = ",", header = TRUE, skip = 0, na.strings = c("NA", "NaN", ".", "*", ""), fileEncoding = "UTF-8-BOM")
  mycsv$file_name <- filename
  mycsv
}

Try the ActisoftR package in your browser

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

ActisoftR documentation built on Oct. 16, 2018, 5:04 p.m.