haven::read_dta() # Read Stata .dta filesreadr::read_csv() # Read comma separated filesreadr::read_delim() # Read files separated (delimited) by other things (;, :, or " ")vroom::vroom() # Fast version of the above two, with some additional featuresreadxl::read_excel() # Read excel files
Use the functions with here() ::: {.cell}
read_csv(file =here("raw_data", "soldiers.csv"))
:::
read.csv()vs.read_csv()
read_csv()vs.read_csv2()
Selected file handling functions
list.files() # Gives a vector of filenameslist.files(pattern ="csv") # Gives a vector of filenames containing 'csv'
file.exists() # TRUE/FALSE if a given file exists
file.choose() # Opens an interactive box that lets you choose a file via browsing