How to use sas7bdat Package In R Language

Here we will use sas7bdat package to import the SAS files.

To install the package:

install.packages('sas7bdat')

To import the SAS file read_sas() methods are capable to read the file.

Syntax: 

read_sas7bdat(‘file’)

Example: Reading SAS file

R




# import lib
library(sas7bdat)
 
# import data
data <- read_sas7bdat('lond_small.sas7bdat')
 
# display data
data


Output:


How to Import SAS Files into R?

In this article, we are going to see how to import SAS files(.sas7bdat) into R Programming Language. 

SAS stands for Statistical Analysis Software, it contains SAS program code saved in a propriety binary format. The R packages discussed, haven and sas7bdat, involved reverse engineering this propriety format.

Used File: Click

Similar Reads

Method 1: Using haven Package

Here we will use the haven package to import the SAS files....

Method 2: Using sas7bdat Package

...

Contact Us