Tidyverse

Reading SAS, SPSS, or Stata files into R using haven

One of the biggest benefits of using R is its flexibility in working with various types of data used by other statistical software. If you are collaborating with other researchers, they may be working with data produced by SAS (.sas7bdat), SPSS (.sav), or Stata (.dta). The haven package in R was developed specifically to import and export data in these formats. Similar to readr for rectangular text data, haven’s functions read files in these formats into a tibble object in R.
Read more

Reading Rectangular Data Into R Using readr

The first step of an analysis in R is to read in your data. Data files can come in many different formats, but are commonly in a plain-text rectangular format such as .csv, .tsv, or .txt. The readr package allows you to read in such files. Most of readr’s functions are related to turning flat files into a tibble object, which is modern R’s internal data format. A tibble can then be manipulated to create summary tables or plots, run statistical tests, or perform other common analysis tasks.
Read more