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 schemes of comparing two sets of continuous data by R language ggplot2 drawing?

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

R language ggplot2 drawing to compare the two groups of continuous data of several solutions are, many novices are not very clear, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.

The grouping comparison of continuous data is very common in scientific research life, such as the comparison of gene expression between the experimental group and the control group, the comparison of some examination indexes between the clinical patient survival group and the death group, and so on. T-test is usually used to check whether there are differences between two sets of continuous data. The data can usually be displayed in several ways, such as column chart, box line chart, violin chart, histogram, scatter chart and so on. Today's tweet introduces the ggplot2 implementation code of the above five graphics.

The following code uses three R language packs

Respectively, ggplot2 is used to draw pictures, RColorBrewer is used to generate color dplyr, and it is used to organize data.

Ggplot2 and dplyr need to be installed if they are used for the first time, the command used for installation is

Install.packages ("ggplot2")

Install.packages ("dplyr")

The first is the analog data set set.seed (1234)

Crp1

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: 0

*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

Internet Technology

Wechat

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

12
Report