1.2 Text files

The readr package provides functions for importing delimited text files into R data frames.

library(readr)

# import data from a comma delimited file
Salaries <- read_csv("data/salaries.csv")

# import data from a tab delimited file
Salaries <- read_tsv("data/salaries.txt")