If your life as an ecologist is spent loading/writing .csv files in R, you should be using readr. Why? Well it’s a Hadley Wickham package for one. But really, it’s defaults make sense!
- read_csv: strings are assumed as characters, not factors. FINALLY!
- write_csv: doesn’t include row numbers by default.
- readr recognizes YYYY-mm-dd format. Goodbye strptime!
- In v0.2, readr looks at the first 1000 rows when guessing column types (although 5000 would be handy too).
Read all about v.0.2.0 in the RStudio Blog.
While readr is my friend 99% of the time, not everything is sunshine and lollipops. For instance, while looping through thousands of files, I would randomly get an “unknown TZ” error, even when setting a timezone. After banging my head a few times, I went back to read.csv. You can’t win ’em all.