R language: Drawing the Knowledge map

Source: Internet
Author: User

The Knowledge atlas is mainly through the application of mathematics, graphics, information visualization technology, information science and other disciplines of the theory and methodology and Metrology citation analysis, co-existing analysis and other methods, the use of visual Atlas to visually display the core structure of the subject, development history, The modern theory of the frontier field and the whole knowledge structure to achieve multi-disciplinary integration.

Today we use the Simplenetwork function in the networkD3 package to draw a knowledge map similar to the CSDN development, as follows:


First of all, we first analyze this picture, the figure of the payment-payment, small program-small program, and so on, they do not need to connect, but here is to look good, there are these connections, but actually there is no meaning. The use of the Simplenetwork function does not draw similar payments--payments of this relationship. I have compiled this data in a TXT file, as follows.



Next we analyze simplenetwork, which has the following prototype:

Simplenetwork (Data, Source = null, Target = NULL, height = null,    width = null, Linkdistance = $, charge = -200, FontS ize = 7,    fontFamily = "Serif", Linkcolour = "#666", Nodecolour = "#3182bd",    nodeclickcolour = "#E34A33", Textcolou r = "#3182bd", opacity = 0.6,    zoom = F)  

The parameters are explained as follows:

Data

Data source

Source

The default is the first row of the data frame, the network source variable

Target

The default is the second row of the data frame, the network source target variable

Height

Set the page size of an image

Width

Set the page size of an image

Linkdistance

The length of the middle line, the default is 50, the greater the value, the longer the connection

Charge

The attraction between points and points, the greater the value, the closer the distance between points and points, the smaller the value, the greater the distance between points and points

FontSize

Node name font size

FontFamily

Set Label font

Linkcolour

Connection color

Nodecolour

Node color

Nodeclickcolour

Post-click Color

Textcolour

Font Color

Opacity

Opacity=0, the opacity is 0, the image is not visible, the maximum value is 1, and more than 1 also defaults to 1

Zoom

A logical value of true is can be scaled, false when it cannot be scaled

I think there is this parameter table above, and you will certainly know the simplenetwork function very well. First we come to one of the simplest.

Data<-read.table ("Network.txt", Header = FALSE, Sep = "") #读取数据  simplenetwork (data)  

  

The results are as follows:

Now let's add some more parameters and look at the overall effect.

Simplenetwork (data, #数据         fontfamily= "Chinese Xingkai", #字体设置         linkcolour= "#B23AEE", #连线颜色         nodecolour= "#00CD66", # Node color         textcolour= "#0000FF", #文本颜色         charge = -550, #节点之间的引力         opacity=0.9, #透明度         zoom=true #可缩放  

  

The results are as follows:



As for the other parameters, you can try it yourself. , follow my public number "follow the rookie to learn R language", reply to Simplenetwork, you can get the test data and RGB color query table.


Reprint please specify the original link: http://blog.csdn.net/wzgl__wh/article/details/53290514

R language: Drawing the Knowledge map

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.