[R] Fwd: Re: Reading xpt files into R

WRAY NICHOLAS n|cho|@@@wr@y @end|ng |rom nt|wor|d@com
Sat Apr 14 21:18:46 CEST 2018


-------- Original Message ----------
From: WRAY NICHOLAS <nicholas.wray using ntlworld.com>
To: peter dalgaard <pdalgd using gmail.com>
Date: 14 April 2018 at 20:18
Subject: Re: [R] Reading xpt files into R


Well yesterday I'd downloaded the "foreign" package and tried to open the xpt file using that:

library(foreign)
read.xport("test.xpt")

I got the following error and warning messages:

> read.xport("test.xpt")
Error in read.xport("test.xpt") : 
The specified file does not start with a SAS xport file header!
In addition: Warning message:
In readBin(file, what = character(0), n = 1, size = nchar(xport.file.header,  :
null terminator not found: breaking string at 10000 bytes

I can open the xpt using wordpad and there is a header but it seems to be just text.  I really don't know what constitutes an "
SAS xport file header"

Nick



On 14 April 2018 at 10:32 peter dalgaard <pdalgd using gmail.com> wrote:

That's what he tried, but the bottom line is that just because something is called foo.xpt there is no guarantee that it actually is a SAS XPORT file. Firefox plugins use the same extension but it could really be anything - naming conventions are just that: conventions.

So dig deeper and find out what the file really is (or was supposed to be).

-pd

> 
>             On 14 Apr 2018, at 00:18 , David Winsemius <dwinsemius using comcast.net> wrote:
> 
>             There is a read.xport function in the foreign package and I think most people would have chosen that one as a first attemp. It's part of the standard R distribution. It refers you to https://support.sas.com/techsup/technote/ts140.pdf for details on the format.
> 
>         
--
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes using cbs.dk Priv: PDalgd using gmail.com




 

	[[alternative HTML version deleted]]




More information about the R-help mailing list