Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the visualization functions of R language correlation

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "what are the R language related visualization functions". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1. Pairs {graphics}

1. Referenc

(1) "Modern Statistical Graph" 5.17 scatter plot matrix

(2) "R data Visualization Manual" 5.13 drawing scatter plot matrix

(3) pairs {graphics} help documentation

two。 Interpretation of main parameters

3. Graphic example

3.1 basic graphics

Pairs (iris [1:4], main = "Anderson's Iris Data-- 3 species", pch = 21, bg = c ("red", "green3", "blue") [unclass (iris$Species)]) # is equivalent to pairs (~ Sepal.Length+Sepal.Width+Petal.Length+Petal.Width, data=iris,main = "Anderson's Iris Data-- 3 species", pch = 21, bg = c ("red", "green3", "blue") [unclass (iris$Species)])

In the above example, the first four columns of Sepal.Length, Sepal.Width, Petal.Length and Petal.Width of iris Iris data set are selected to draw, and bg is set to make different colors represent different varieties of Iris. It can be seen that the diagonal of the scatter matrix generated by default is the name of the variable, and each pane of the upper triangle and the lower triangle panel is the scatter chart between the row and column, and the amount of information transmission is relatively small and repetitive. To this end, we can further modify and optimize through custom functions.

3.2 Custom Drawin

# 1. Custom function pannel.cor: displays the correlation coefficient between two variables, the larger the correlation coefficient, the larger the font size. Panel.cor

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 273

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report