This is not what I wanted: How to parse XML to R data frame
I don't know xml well and have a xml file as:
data <- xmlParse("file1.xml")
print(data)
# $`PAMRasterBand`
# <PAMRasterBand band="1">
# <Metadata>
# <MDI key="STATISTICS_MAXIMUM">0.43242582678795</MDI>
# <MDI key="STATISTICS_MEAN">0.11312322099674</MDI>
# <MDI key="STATISTICS_MINIMUM">-0.019055815413594</MDI>
# <MDI key="STATISTICS_STDDEV">0.054616362290023</MDI>
# <MDI key="STATISTICS_VALID_PERCENT">61.25</MDI>
# </Metadata>
# </PAMRasterBand>
I want to parse the value of "STATISTICS_MEAN" from it and turn it to the data.table or data.frame in R.
I saw some examples but couldn't really get how to do it specifically for this purpose. I want to do this for 439 files as above in a loop.[From File1 to File439, every file has the same attributes] So, if you helped me to loop it, I would be flattered.