Hi,

'foreign' will only read SAS XPT files, not the proprietary BDAT files, which I 
presume is the case here.

I don't use 'haven', but it looks like the key functions are written in C/C++, 
which should be relatively efficient.

If you are having specific issues with particular files,  because they are 
rather large, and/or have some kind of complex structure, you might want to 
communicate directly with the haven maintainers to see if there are some 
performance bottlenecks that perhaps they can resolve.

The only other option, to my knowledge, to directly read BDAT files in R, is 
the sas7bdat package on CRAN:

  https://cran.r-project.org/web/packages/sas7bdat/ 
<https://cran.r-project.org/web/packages/sas7bdat/>

However, it looks like it has not been updated in several years, so not sure of 
status.

Another alternative, if you have access to SAS, is to export the BDAT 
datasets(s) to CSV files in SAS, and them import them into R, using read.csv().

Regards,

Marc Schwartz


> On Oct 19, 2018, at 10:41 AM, Bert Gunter <bgunter.4...@gmail.com> wrote:
> 
> Have you looked at the "foreign" package?
> 
> -- Bert
> 
> Bert Gunter
> 
> "The trouble with having an open mind is that people keep coming along and
> sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
> 
> 
> On Fri, Oct 19, 2018 at 6:48 AM Jomy Jose <infoj...@gmail.com> wrote:
> 
>> Hi
>> 
>> Is there an efficient way to import SAS datasets into R,presently while
>> using haven package it takes long time...Is there a smart work around this
>> ?
>> 
>> Thanks in advance
>> Jose


        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to