Dear All, I am given some data to analyze. The data is in the form of a Stata database (.dta file). What is the best way to import it into an R dataframe? Is there any particular caveat I should be aware of? Many thanks Lorenzo
Install the "ares" library first. Then type import.data("the direction you have saved the data","dta"). On Fri, Oct 26, 2012 at 11:10 PM, Lorenzo Isella <lorenzo.isella@gmail.com>wrote:> Dear All, > I am given some data to analyze. The data is in the form of a Stata > database (.dta file). > What is the best way to import it into an R dataframe? > Is there any particular caveat I should be aware of? > Many thanks > > Lorenzo > > ______________________________**________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help> > PLEASE do read the posting guide http://www.R-project.org/** > posting-guide.html <http://www.R-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
A look at the R data import/export page supplied in the R HTML help system (see the link at top left) says that stata files are handled by the foreign package. S Ellison ________________________________________ From: r-help-bounces at r-project.org [r-help-bounces at r-project.org] On Behalf Of Lorenzo Isella [lorenzo.isella at gmail.com] Sent: 26 October 2012 21:10 To: r-help at stat.math.ethz.ch Subject: [R] Stata Database & R Dear All, I am given some data to analyze. The data is in the form of a Stata database (.dta file). What is the best way to import it into an R dataframe? Is there any particular caveat I should be aware of? Many thanks Lorenzo ______________________________________________ R-help at r-project.org mailing list 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. ******************************************************************* This email and any attachments are confidential. Any use...{{dropped:8}}