I have multiple CSV files to upload to RStudio. Based on Google search, I have found many ways to upload these files. I want all the csv files to be in one data frame and change some column type to char. I am trying method below:
read.csv does not have a argument called col_types. It has one named colClasses.
Most probably you wanted to use read_csv instead of read.csv.
Since you're using tidyverse, probably you'll be better off with bind_rows. Also, if you want to use the tidyverse functions only, you can use map instead of lapply.
In terms of performance there is not much difference, but since you are loading tidyversepurrr::map() is part of that family of packages, so integrates easily with other tidyverse packages, it works well with piped (%>%) commands, it has consistent parameters and the output type is predictable (from its variants e.g. map_dbl, map_int, etc.) and consistent.
The reason I am using tidyverse is the R e-book I am reading right now is using it. I welcome if there is a better way to do this. It just that my knowledge of R is still very limited so if the codes seem to produce what I need, I am ok with it.