How to batch read multiple XML files in R and create a frequency table from the files

Hi,
I want to ask how to batch read multiple XML files and create a frequency table in R.

My XML files are tree-parsed in XML format, and they are about 1000.
The ultimate data frame should look like a table with several variables in a row and each of the texts in a column (or vice versa).
So, I think this could be either:

  1. import these 1000 files into R and create a frequency table
  2. create a frequency table without reading the files into R

Would you please give me a clue and suggest which function to start with?
I am a complete newbie and would appreciate any suggestion. Many thanks for considering my request.

Hi,

Welcome to the RStudio community!

XML files can be trick sometimes as they not always can be easily mapped to a data frame (which you like to have in the end). It really depends on the data you have, so I suggest you play around with the XML package and see how far you get. Here is a nice introduction:

Hope this helps,
PJ

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.