Plain text-based files
Comma-separated values (.csv
)
Tab-separated values (.tsv
& .txt
)
Plain text-based files
JavaScript Object Notation (.json
)
Yet Another Markup Language (.yml
& .yaml
)
Suggested function:
jsonlite::fromJSON()
Suggested function:
yaml::read_yaml()
Extensible Markup Language (.xml
)
Hypertext Markup Language (.html
)
Suggested function:
xml2::read_xml()
Suggested function:
xml2::read_html()
Plain text-based files
Other plain text files (.txt
, etc.)
Suggested function:
readLines()
Spreadsheets
Microsoft Excel (.xls
& .xlsx
)
Google Sheets (online)
Suggested functions:
readxl::read_excel()
readxl::read_xls()
readxl::read_xlsx()
Suggested function:
gsheet::gsheet2tbl()
OpenDocument Spreadsheet (.ods
)
Suggested functions:
readODS::read_ods()
binary files
saved objects (.Rdata
& .rds
)
Quick Serialization of Objects (.qs
)
Suggested functions:
load()
readRDS()
Suggested function:
qs::qread()
Images (rasters)
Joint Photographic Experts Group (.jpg
& .jpeg
)
Portable Network Graphics (.png
)
Suggested function:
jpeg::readJPEG()
Suggested function:
png::readPNG()
Tagged Image File Format (.tif
& .tiff
)
Suggested function:
tiff::readTIFF()
Spatial data files
Vector layers (.shp
, .geojson
, .gpkg
, etc.)
Raster layers (.tif
, .asc
, .grd
, etc.)
Suggested functions:
sf::st_read()
terra::vect()
Suggested function:
terra::rast()
Network Common Data Form - NetCDF (.nc
)
Suggested functions:
ncdf4::nc_open()
terra::rast()
SQL databases
MySQL
PostgreSQL
SQLite (.sql
)
Other formats
Portable Document Format (.pdf
)
BibTex (.bib
)
Suggested function:
pdftools::pdf_text()
Suggested function:
bib2df::bib2df()
Compressed archives
ZIP files (.zip
)
TAR files (.tar
)
Suggested function:
unzip()
Suggested function:
untar()
Use the function readr::guess_encoding()
to find the good encoding.