How would I parse the XML file in R and carry out basic Statistics Analysis on the data

后端 未结 2 1419
南方客
南方客 2020-12-15 01:55

I am trying to parse the XML file in R, so that I can analysis the data. I am trying to get the mean and standard deviation of the price. Also I would like to be able to get

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-15 02:30

    For more complex XML data, it might useful to use the XML package.

    library(XML)
    
    check <- xmlInternalTreeParse("/PathToXMLFile/checkXML.xml")
    xpathSApply(check, "//timeStamp", xmlValue)
    ## [1] " 12:00:00:01"  " 12:00:00:02"  " 12:00:00:025" " 12:00:00:031"
    ## [5] " 12:00:00:039" " 12:00:00:050" " 12:00:01:01" 
    

提交回复
热议问题