Hey, I am trying to concatenate different CSV files into one data frame. However, seem to find this error below when I try to run the run code.
Error: Files must have consistent column names:
- File 1 column 1 is:
Please find the code below:
files <- list.files(pattern =".csv")
act_weather_data <- data
for(i in 1:length(files)){
data <- read_csv(files, show_col_types = FALSE)
assertthat::assert_that(nrow(problems(data)) == 0,
msg="There is still problem/s, which you need to fix first")
temp <- tryCatch(
expr = { parse_date(data$Date, AU_Date_Format)},
warning = function(x) { parse_date(data$Date, AU_Date_Format)})
Date <- format(temp, AU_Date_Format)
act_weather_data <- cbind(act_weather_data, data)
}