Open XPT File with R
This page describes how to open XPT files (aka SAS Transport v5 files as commonly used in CDISC datasets) using R packages.
Generally, in order to use XPT files, organizations will employ SAS, as it has native handling for them. However, not everyone has SAS. Or maybe the type of person who needs to work with the files wouldn't otherwise need a SAS license.
One option is to download and use the free Universal Xpt File Viewer. This was previously known as the SAS Viewer, so if you have the SAS Viewer tool, that works in the same way. This is free, and easily accessible; however, it is very limited in features and not suited to automated handling of files.
The steps below guide you through how to open XPT files using R, a collection of free, open source statistical packages.
- Download and install the windows binary from the R Project site
- Launch R and from the Packages menu select install to download and install these two packages
- Set the current directory to the directory containing the *.xpt file: (File -> Change dir …)
- Issue these commands (sample uses bw.xpt; sub in whatever your file is named):
- Alfalfa <- read.xport("bw.xpt")
- head (Alfalfa)
Last revision by Angusmdmclean, 2017-01-7