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

William Dunlap wdun|@p @end|ng |rom t|bco@com
Sat Apr 14 22:09:31 CEST 2018


Does read.xport read both version 5 and version 8 xpt files?  This link to
the Library of Congress can get you started on how to interpret the
header.  (It states that Version 8 was introduced in 2012 but was not in
wide use as of early 2017.)

https://www.loc.gov/preservation/digital/formats/fdd/fdd000464.shtml

Bill Dunlap
TIBCO Software
wdunlap tibco.com

On Sat, Apr 14, 2018 at 12:18 PM, WRAY NICHOLAS via R-help <
r-help using r-project.org> wrote:

>
> -------- 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]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]




More information about the R-help mailing list