Home > Backend Development > XML/RSS Tutorial > XML package to import and process XML data format | R package

XML package to import and process XML data format | R package

黄舟
Release: 2017-02-25 14:03:15
Original
1989 people have browsed it

XML package to import and process XML data format | R package

What is XML?

• XML stands for EXtensible Markup Language
• XML Is a markup language, much like HTML
• XML is designed to transmit data, not display data
• XML tags are not predefined. You need to define the labels yourself.
• XML is designed to be self-describing.
• XML is a recommended standard by W3C

For a more detailed introduction to XML, please see the link: http://www.w3school.com.cn/xml/xml_intro.asp

R How does the language parse XML?

The R language provides an XML package to parse XML data format, including importing XML data and processing XML data. Examples are as follows.

## 加载XML包
library('XML')
## 自定义一个XML数据内容
content <-   
&#39;<note>  
<name>shujuren</name>  
<url>http://shujuren.org</url>  
<date>2016-01-01</date>  
</note>&#39;
doc <- xmlParse(content, encoding="UTF-8")xmlToList(doc)
# use an R-level node representationdoc1 <- xmlTreeParse(content)xmlToList(doc1)
## 转换成DataFrame类型xmlToDataFrame(doc)
Copy after login

The results of the data frame are as follows:

            text1            
            shujuren2 
            http://shujuren.org3          
            2016-01-01
Copy after login

Thinking:
The address book on the mobile phone can be imported into XML data format. How to import and process it using XML in R language?
Reference link:
//m.sbmmt.com/xml_rss-353691.html

The above is the XML package for importing and processing XML data format|R package Content, please pay attention to the PHP Chinese website (m.sbmmt.com) for more related content!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template