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?
Content-Type: text/plain; charset=us-ascii
email@example.com (Mary) writes:
> 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;
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
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.