LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2008, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 28 Aug 2008 16:52:53 -0500
Reply-To:     Marc Schwartz <marc_schwartz@COMCAST.NET>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Marc Schwartz <marc_schwartz@COMCAST.NET>
Subject:      Re: Best XML Type for use in R on Linux?
Comments: To:
Content-Type: text/plain; charset=us-ascii (Mary) writes:

> Hi, > > I want to export a SAS data set as an XML document that will be used by > someone using R on Linux. Is there a particular type of XML that would be > best? I am thinking of using the Oracle type: > > libname myfiles 'SAS-library'; > > libname trans xml 'XML-document' xmltype=oracle; > > data trans.class; > set myfiles.class; > run; > > -Mary

Did the person to whom you are sending the dataset specifically request XML? If not, then XML is a rather inefficient way of transferring datasets given all the overhead of parsing the tree.

You would be better off just sending them a CSV file with a header row that contains the field names. That's the easiest and most ubiquitous way of getting data into R. There are typical default data types that R will utilize during the import and others can be defined explicitly either during the import or post hoc.

Alternatively, if this is coming from an Oracle server and they will have access to said server, they can use either the RODBC package or the ROracle package to directly access the Oracle tables/views from within R via SQL queries. I use the former on Linux.

Lastly, if they have executable access to a SAS installation, they can use one of at least two different functions in R to directly read in a SAS dataset.

The R Import/Export Manual is available here:

if you should want to explore options with your intended recipient.

Feel free to send me an e-mail directly with further questions.


Marc Schwartz

Back to: Top of message | Previous page | Main SAS-L page