-------- Original Message ----------
From: WRAY NICHOLAS <nicholas.w...@ntlworld.com>
To: peter dalgaard <pda...@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:


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"


On 14 April 2018 at 10:32 peter dalgaard <pda...@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).


>             On 14 Apr 2018, at 00:18 , David Winsemius 
> <dwinsem...@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....@cbs.dk Priv: pda...@gmail.com


        [[alternative HTML version deleted]]

R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to