IMPORT AND EXPORT DATA IN R
R offers versatile functions and packages like readr, readxl, and foreign for importing data from formats like TXT, CSV, Excel, databases and to export them
IMPORT DATA
Importing data allows loading different data sets into R from external files, such as TXT, CSV, XLS, XLSX and even reading databases or the content of web pages

Read TXT
read.table() read.delim() read.delim2()

Read CSV
read.csv() read.csv2()

Read Excel files (XLS and XLSX)
readxl openxlsx xlsx XLConnect

Read SQL databases
DBI dbConnect() dbReadTable() dbWriteTable() dbListTables() dbListFields() dbSendQuery() dbDisconnect()

Web scraping with rvest
rvest read_html() html_element() html_text2() html_elements() html_attr() html_attrs() html_table()
EXPORT DATA
Data export allows you to store analysis results in files that can be shared or used in other environments