IMPORTR: Stata module to import R data files (.Rdata,.Rda,.Rds) into Stata over an R or Python bridge
Eric A. Booth ()
Additional contact information
Eric A. Booth: Texas 2036
Statistical Software Components from Boston College Department of Economics
Abstract:
.Rdata and .Rds files are compressed binary objects in R's own serialization format, so there is no pure-Stata way to read them; something outside Stata has to do the decoding. importr takes a dual-bridge approach so that it works on machines with R and on machines without it. It first looks for Rscript and, if found, converts the file through the haven package. If R is absent it falls back to Stata's built-in Python integration and the pyreadstat library. Either path lands the data in memory; the choice is reported so you know which bridge ran. Handles .Rdata, .Rda, and .Rds. R with the haven package (Rscript on the PATH), or Stata's Python integration with pyreadstat (python pip install pyreadstat).
Language: Stata
Requires: Stata version 16.0
Keywords: import; R; data management; interoperability (search for similar items in EconPapers)
Date: 2026-07-30
Note: This module should be installed from within Stata by typing "ssc install importr". The module is made available under terms of the MIT license (https://opensource.org/licenses/MIT).
References: Add references at CitEc
Citations:
Downloads: (external link)
http://fmwww.bc.edu/repec/bocode/e/example.Rdata example dataset (application/octet-stream)
http://fmwww.bc.edu/repec/bocode/i/importr.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/i/importr.sthlp help file (text/plain)
Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.
Export reference: BibTeX
RIS (EndNote, ProCite, RefMan)
HTML/Text
Persistent link: https://EconPapers.repec.org/RePEc:boc:bocode:s459835
Ordering information: This software item can be ordered from
http://repec.org/docs/ssc.php
Access Statistics for this software item
More software in Statistical Software Components from Boston College Department of Economics Boston College, 140 Commonwealth Avenue, Chestnut Hill MA 02467 USA. Contact information at EDIRC.
Bibliographic data for series maintained by Christopher F Baum ().