#' my_csv_reader
#'
#' Read multiple CSV files into a list
#' @param folderPath Path to folder which contains the CSV files to be read
#' @return List containing data from the CSV files
#' @import assertthat
#' @importFrom utils read.csv2
#' @examples
#' my_csv_reader("/User/Documents/CsvFolder")
#' @export
my_csv_reader <- function(folderPath) {
assert_that(is.dir(folderPath))
assert_that(is.readable(folderPath))
fileNames <- list.files(path = folderPath, pattern = ".*csv$", full.names = TRUE)
fileList <- list()
for (fileName in fileNames) {
fileList[[fileName]] <- (as.list(read.csv2(file = fileName)))
}
return(fileList)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.