r语言 绘制直方图

您所在的位置:网站首页 r语言怎么绘制直方图 r语言 绘制直方图

r语言 绘制直方图

2024-06-13 05:39| 来源: 网络整理| 查看: 265

r语言 绘制直方图

In this tutorial, we’ll go over the steps to plot a histogram in R. A histogram is a graphical representation of the values along with its range. It is similar to a bar plot and each bar present in a histogram will represent the range and height of the specified value.

在本教程中,我们将介绍在R中绘制直方图的步骤。 直方图是值及其范围的图形表示。 它类似于条形图,直方图中的每个条形都将表示指定值的范围和高度。

R offers standard function hist() to plot the histogram in Rstudio. It also offers function geom_density() to plot histogram using ggplot2.

R提供标准函数hist()来绘制Rstudio中的直方图。 它还提供了函数geom_density()来使用ggplot2绘制直方图。

直方图的优点 (Advantages of Histograms) A histogram provides the distribution of the data, frequency of the data along with its range.

直方图提供数据的分布,数据的频率及其范围。 It is an easier way to visualize large data sets.

这是一种可视化大型数据集的简便方法。 The histogram also shows the skewness of the data.

直方图还显示了数据的偏度 。 R中直方图的类型 (Types of Histogram plots in R)

Based on the distribution of the data, a histogram exhibits many different shapes. In this section, we will try to understand the different types of histogram shapes and their meaning.

根据数据的分布,直方图显示许多不同的形状。 在本节中,我们将尝试了解直方图形状的不同类型及其含义。

The major types of histogram distributions are,

直方图分布的主要类型是

Normal distribution.

正态分布。 Right skewed distribution.

右偏分布。 Left skewed distribution.

左偏分布。 Bimodal distribution

双峰分布 R中的基本直方图 (Basic Histogram in R)

In this section, we will plot a simple histogram using the ‘airquality’ data set.

在本节中,我们将使用“空气质量”数据集绘制一个简单的直方图。

Execute the below code to plot this simple histogram.

执行以下代码以绘制此简单直方图。



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3