IMPORTR: Stata module to import R data files (.Rdata,.Rda,.Rds) into Stata over an R or Python bridge
Eric Booth
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 tries R, converting the file through the haven package; if that does not produce a dataset it falls back to Stata's built-in Python integration, reading with pyreadr and writing with pyreadstat. Either path lands the data in memory, and the bridge that succeeded is reported. Handles .Rdata, .Rda, and .Rds.
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/i/importr.ado program code (text/plain)
http://fmwww.bc.edu/repec/bocode/i/importr.sthlp help file (text/plain)
http://fmwww.bc.edu/repec/bocode/i/importr_example.rdata example R data file (application/octet-stream)
http://fmwww.bc.edu/repec/bocode/i/importr_example.rds example R data file (application/octet-stream)
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 ().