Skip to content

XML to CSV

2 messages · Andrew Lachance, Ben Tupper

#
up votdown votefavorite
<http://stats.stackexchange.com/questions/254328/how-to-convert-a-large-xml-file-to-a-csv-file-using-r?noredirect=1#>

I am completely new to R and have tried to use several functions within the
xml packages to convert an XML to a csv and have had little success. Since
I am so new, I am not sure what the necessary steps are to complete this
conversion without a lot of NA.
#
Hi,

It's hard to know what to advise - much depends upon the XML data you have and what you want to extract from it. Without knowing about those two things there is little anyone could do to help.  Can you post to the internet a to example data and provide the link here?  Then state explicitly what you want to have in hand at the end.

If you are just starting out I suggest that you try xml2 package ( https://cran.r-project.org/web/packages/xml2/ ) rather than XML package ( https://cran.r-project.org/web/packages/XML/ ). I have been using it much more since the authors added the ability to create xml nodes (rather than just extracting data from existing xml nodes).  

Cheers,
Ben

P.S.  Hello to my niece Olivia S on the Bates EMS team.
Ben Tupper
Bigelow Laboratory for Ocean Sciences
60 Bigelow Drive, P.O. Box 380
East Boothbay, Maine 04544
http://www.bigelow.org