Dear ALL: Could you please let me know how to read SAS data file into R. Thank you so much for your helps. Regards; Abou =========================AbouEl-Makarim Aboueissa, Ph.D. Assistant Professor of Statistics Department of Mathematics & Statistics University of Southern Maine 96 Falmouth Street P.O. Box 9300 Portland, ME 04104-9300 Tel: (207) 228-8389 Email: aaboueissa at usm.maine.edu aboueiss at yahoo.com Office: 301C Payson Smith
Have a look at the Hmisc package:sas.get or sasxport.get. In either case you need to have a working SAS installation on the same machine. Another way, although you lose label is simply to export the SAS data file as a csv or delim file and import it. --- AbouEl-Makarim Aboueissa <aaboueissa at usm.maine.edu> wrote:> Dear ALL: > > Could you please let me know how to read SAS data > file into R. > > Thank you so much for your helps. > > Regards; > > Abou > > > =========================> AbouEl-Makarim Aboueissa, Ph.D. > Assistant Professor of Statistics > Department of Mathematics & Statistics > University of Southern Maine > 96 Falmouth Street > P.O. Box 9300 > Portland, ME 04104-9300 > > Tel: (207) 228-8389 > Email: aaboueissa at usm.maine.edu > aboueiss at yahoo.com > Office: 301C Payson Smith > > ______________________________________________ > R-help at stat.math.ethz.ch 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. >
see foreign package. but personally, i think it might be better to transfer through csv or db. On 5/10/07, AbouEl-Makarim Aboueissa <aaboueissa at usm.maine.edu> wrote:> Dear ALL: > > Could you please let me know how to read SAS data file into R. > > Thank you so much for your helps. > > Regards; > > Abou > > > =========================> AbouEl-Makarim Aboueissa, Ph.D. > Assistant Professor of Statistics > Department of Mathematics & Statistics > University of Southern Maine > 96 Falmouth Street > P.O. Box 9300 > Portland, ME 04104-9300 > > Tel: (207) 228-8389 > Email: aaboueissa at usm.maine.edu > aboueiss at yahoo.com > Office: 301C Payson Smith > > ______________________________________________ > R-help at stat.math.ethz.ch 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. >-- WenSui Liu A lousy statistician who happens to know a little programming (http://spaces.msn.com/statcompute/blog)
Kim?s EZ Recipe for?. SAS TO R, perfectly formatted table with no loss of data ? In SAS: Export SAS DB as access db ? In R go to directory where access db is stored ? Use package RODBC #R code #Create connection object (Can set up DSN but I?m too lazy to) c<-odbcConnectAccess("x.mdb") #Create table object, store db in object x<-sqlFetch(c, "test") #Close connection object odbcClose(c) -- View this message in context: http://www.nabble.com/Read-SAS-data-into-R-tf3723790.html#a10434169 Sent from the R help mailing list archive at Nabble.com.
Hopefully quick question. I would like to populate a list with n objects using a for loop, so within the loop (i to n) I need to refer to a list as example.list[[i]] . This requires that I create a example.list[[i]] with n objects before the for loop. How do I do this? With matrices it is easy (matrix()). thanks! Sam
On Fri, 11 May 2007, Sam Field wrote:> Hopefully quick question. I would like to populate a list with n > objects using a for loop, so within the loop (i to n) I need to refer > to a list as example.list[[i]] . This requires that I create a > example.list[[i]] with n objects before the for loop. How do I do > this? With matrices it is easy (matrix()).And with lists equally easy via vector("list", n), which is mentioned on the help page for list. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
mylist <- as.list (matrix(1:5)) might work. Note the elements of the list are not empty --- Sam Field <fieldsh at mail.med.upenn.edu> wrote:> Hopefully quick question. I would like to populate > a list with n > objects using a for loop, so within the loop (i to > n) I need to refer > to a list as example.list[[i]] . This requires that > I create a > example.list[[i]] with n objects before the for > loop. How do I do > this? With matrices it is easy (matrix()). > > thanks! > > Sam