I'm trying to combine multiple .csv files into one in a nice and easy script. Currently, I have the code
data_files = list.files(path=file_source, pattern = "*.csv", full.names = TRUE) %>%
lapply(read_csv) %>%
bind_rows
but when inspecting the output it has replaced some values with NA. I believe this to be because some values are non-numeric, i.e. SMITH_201. Is there a way I can avoid this so that the non-numeric values are preserved?
EDIT:
An example of what I'm trying to do. I have multiple .csv files such as those below
file_A.csv looks like this
x y
1 1
2 1
3 1
4 1
file_B.csv looks like this
x y
5 2
6 2
A3 2
A4 1
and I want to combine them to be a single .csv
x y
1 1
2 1
3 1
4 1
5 2
6 2
A3 2
A4 1