[R] Reading xpt files into R

WRAY NICHOLAS nichol@@@wr@y @ending from ntlworld@com
Fri Apr 13 19:01:56 CEST 2018


Hello R folk

I have an xpt file which I have been trying to open into R in R studio

On the net I found guidance which says that I need packages Hmisc and SASxport which I have successfully loaded.

I had also found some code which says that this would allow me to read the xpt file into R:

library(SASxport)
data(Alfalfa)
lookup.xport("test.xpt")
Alfalfa<-read.xport("test.xpt")

I have set the directory correctly as far as I am aware, but when I tried to run this code I got the following error messages:

> lookup.xport("test.xpt")
Error in lookup.xport.inner(file) : file not in SAS transfer format
> Alfalfa<-read.xport("test.xpt")
Error in read.xport("test.xpt") : 
The specified file does not start with a SAS xport file header!

I neither know what the file being not in SAS transfer format means, nor what not starting with an SAS xport file header means either...
If anyone can explain how I can read this xpt file into R I'd be v grateful

Thanks Nick Wray

	[[alternative HTML version deleted]]




More information about the R-help mailing list