I am using the readr
and bind_rows()
function to read multiple csvs.
Example code:
library(readr)
library(dplyr)
df = lapply(c(
"df 4-11-17.csv",
"df 4-12-17.csv",
"df 4-13-17.csv"),
read_csv) %>% bind_rows()
When I do this I get an error stating:
Error: Can not automatically convert from character to Date in column "Date".
The first column name is "Date" and it is in a character format currently. this is what it looks like when I do str(df) for the first column.
Classes ‘tbl_df’, ‘tbl’ and 'data.frame': 961751 obs. of 15 variables:
$ Date : chr "4/10/2017" "4/10/2017" "4/10/2017"
"4/10/2017" ...
If anyone knows how to read multiple csv files at the same time where it disregards the format of the column such as the Date column, it would be helpful!