

{"id":2846,"date":"2017-06-15T10:47:15","date_gmt":"2017-06-15T10:47:15","guid":{"rendered":"http:\/\/data-flair.training\/blogs\/?p=2846"},"modified":"2021-08-25T18:20:58","modified_gmt":"2021-08-25T12:50:58","slug":"descriptive-statistics-in-r","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/descriptive-statistics-in-r\/","title":{"rendered":"Descriptive Statistics in R &#8211; Complete Guide for aspiring Data Scientists!"},"content":{"rendered":"<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:1467,&quot;href&quot;:&quot;https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/R_(programming_language)&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20251001042859\\\/https:\\\/\\\/en.wikipedia.org\\\/wiki\\\/R_(programming_language)&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-09 08:17:04&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-12 12:22:33&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-15 12:29:21&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-18 15:20:53&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-21 18:00:25&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-25 04:08:57&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-28 06:54:42&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2025-12-31 09:47:17&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-03 17:14:22&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-06 19:17:34&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-09 21:09:32&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-13 04:31:41&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-16 15:06:53&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-19 19:03:58&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-23 05:30:29&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-26 10:18:28&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-01-29 11:45:43&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-01 12:00:34&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-04 12:09:55&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-07 15:09:43&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-10 18:01:34&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-13 23:45:59&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-17 05:29:44&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-20 07:23:59&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-23 10:05:24&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-26 14:54:33&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-01 16:00:29&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-04 19:56:49&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-08 03:19:57&quot;,&quot;http_code&quot;:429},{&quot;date&quot;:&quot;2026-03-11 07:47:37&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-14 13:54:22&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-17 17:24:09&quot;,&quot;http_code&quot;:429},{&quot;date&quot;:&quot;2026-03-20 23:04:55&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-24 00:07:34&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-27 00:15:51&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-30 08:20:38&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-03 14:48:26&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-06 19:55:35&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-10 05:52:27&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-13 07:47:26&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-16 08:05:10&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-19 13:04:23&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-22 13:52:44&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-25 13:58:03&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-29 01:16:25&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-02 04:13:02&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-05 06:33:38&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-08 17:48:43&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-12 03:38:06&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-15 04:53:06&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-18 09:15:30&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-21 12:35:48&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-25 03:51:04&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-05-28 07:13:15&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-01 04:45:49&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-06-04 06:40:14&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-07 06:45:43&quot;,&quot;http_code&quot;:404}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-07 06:45:43&quot;,&quot;http_code&quot;:404},&quot;process&quot;:&quot;done&quot;}]'><\/div>\n<p>This article will provide you with a comprehensive explanation of the descriptive statistics in R programming also known as summary statistics. We will learn these R commands along with their use and implementation with the help of examples.<\/p>\n<ul>\n<li>summary<\/li>\n<li>name<\/li>\n<li>apply<\/li>\n<li>simple cumulative<\/li>\n<li>complex cumulative<\/li>\n<\/ul>\n<h2>What is Summary Statistics\/Descriptive Statistics?<\/h2>\n<p>All the data which is gathered for any analysis is useful when it is properly represented so that it is easily understandable by everyone and helps in proper decision making. After we carry out the data analysis, we delineate its summary so as to understand it in a much better way. This is known as <strong>summarizing the data<\/strong>.<\/p>\n<p>We can summarize the data in several ways either by <em>text manner<\/em> or by <em>pictorial representation<\/em>.<\/p>\n<p>We can summarize our data in R as follows:<\/p>\n<ul>\n<li><strong>Descriptive\/Summary Statistics &#8211;<\/strong>\u00a0With the help of descriptive statistics, we can represent the information about our datasets. They also form the platform for carrying out complex computations as well as analysis. Therefore, even though they are developed with simple methods, they play a crucial role in the process of analysis.<\/li>\n<li><strong>Tabulation &#8211;<\/strong>\u00a0Representing the data analyzed in tabular form for easy understanding.<\/li>\n<li><strong>Graphical &#8211;<\/strong>\u00a0It is a way to represent data graphically.<\/li>\n<\/ul>\n<p><em><strong>I hope you have completed the <a href=\"https:\/\/data-flair.training\/blogs\/data-manipulation-in-r\/\">tutorial on Data Manipulation in R<\/a> before proceeding ahead.<\/strong><\/em><\/p>\n<h3>Summary Commands in R<\/h3>\n<p>Whenever you start working on any data set, you need to know the overview of what you are dealing with. There are a few ways of doing this:<\/p>\n<p>As we have seen in the earlier session that <em>ls()<\/em> command is used to know the list of <em>named objects<\/em> that you have. So you can start by using<em> ls<\/em> command for this purpose.<\/p>\n<p>Once you know the objects that are available, you can then type the name of the object to view its content. However, if the object contains a lot of data, the display may be quite large and you may want a more concise method to examine objects.<br \/>\nYou could use the<em> str()<\/em> command which shows you something about the structure of data rather than giving the statistical summary. It will inform you about the number of rows and columns in the data and values in the columns with their respective heads. The <em>str()<\/em> command is designed to help you examine the structure of a data object rather than providing a statistical summary.<\/p>\n<p>The <em>summary()<\/em> command will provide you with a statistical summary of your data.<\/p>\n<p>The output of summary command depends on the object you are looking at. It gives the output as the largest value in data, the least value or mean and median and another similar type of information.<\/p>\n<p>For example, if you have below data:<\/p>\n<p>S.No. \u00a0 \u00a0 \u00a0 \u00a0Item \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Quantity<br \/>\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Pen\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a05<br \/>\n2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Pencil\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 10<br \/>\n3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Rubber \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a012<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">#Author DataFlair\r\ndata &lt;- read.table(header=TRUE, text='\r\nS.No. Item Quantity\r\n1 Pen 5\r\n2 Pencil 10\r\n3 Rubber 12\r\n')\r\nstr(data)    #description of the output\r\nsummary(data)  #statistical summary\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/data-read.table_.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-63805\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/data-read.table_.png\" alt=\"data read.table - Descriptive Statistics in R\" width=\"1298\" height=\"718\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/data-read.table_.png 1298w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/data-read.table_-150x83.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/data-read.table_-300x166.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/data-read.table_-768x425.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/data-read.table_-1024x566.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/data-read.table_-520x288.png 520w\" sizes=\"auto, (max-width: 1298px) 100vw, 1298px\" \/><\/a><\/p>\n<p>The summary command is, therefore, more useful as we can see minimum, maximum, mean, etc values. The summary() command works for both matrix and data frame objects by summarizing the columns rather than the rows.<\/p>\n<p><em><strong>Don&#8217;t miss the concept of <a href=\"https:\/\/data-flair.training\/blogs\/object-oriented-programming-in-r\/\">Object Oriented Programming in R<\/a><\/strong><\/em><\/p>\n<h3>Name Commands in R<\/h3>\n<p>Name command and its variants are used to find or add names to rows and columns of data structures.<\/p>\n<p>Below specified\u00a0are few of the commands and their explanation:<\/p>\n<ul>\n<li><strong>names()<\/strong> &#8211; It works on matrix or data frame objects.<\/li>\n<li><strong>rownames()<\/strong> &#8211; It works on matrix or data frame objects and is used to give names to rows.<\/li>\n<li><strong>colnames()<\/strong> &#8211; It works on matrix or data frame objects and is used to give names to columns.<\/li>\n<li><strong>dimnames()<\/strong> &#8211; Gets row and column names for matrix or data frame objects, that is, it is used to see dimensions of the data frame.<\/li>\n<\/ul>\n<p><em>rownames<\/em>\u00a0and\u00a0<em>row.names<\/em>\u00a0return the same values for the data frame and matrices; the only difference is that where there aren&#8217;t any names present,\u00a0rownames\u00a0will print &#8220;<strong>NULL<\/strong>&#8221; (as does\u00a0colnames), but\u00a0<em>row.names\u00a0<\/em>return it invisibly.<\/p>\n<p>Descriptive statistics is used to analyze data in various types of industries, such as <em>education, information technology, entertainment, retail, agriculture, transport, sales and marketing, psychology, demography, and advertising<\/em>. In a broader sense, it is used as a tool to interpret and analyze data. <strong>For example &#8211;<\/strong>\u00a0With the help of descriptive statistics, a production engineer can uncover the truth behind the breakdown of motors and a manager can supervise the quality of the production process.<\/p>\n<h3>Summarizing Samples in R Programming Language<\/h3>\n<p>When repeated measurements are there, we generally want to summarize data by showing measures like average. R provides a variety of commands that operate on samples. These samples of data might be individual vectors, or they may be columns in a data frame or part of a matrix or list.<\/p>\n<p>Let&#8217;s suppose a survey is conducted to find the average weight of people living in a country. As it is not possible to weigh every person of the country, a sample data of a few thousand individuals is collected. The average weight of the people in the sample would be very near to the average weight of the entire population of that country.<\/p>\n<p>A variety of simple summary statistics can be applied to a vector of numbers. Two kinds of summary commands used are:<\/p>\n<ul>\n<li><strong>Commands for Single Value Results &#8211;<\/strong> Produce single value as a result.<\/li>\n<li><strong>Commands for Multiple Value Result &#8211;<\/strong> Produce multiple results as an output.<\/li>\n<\/ul>\n<p>The next essential concept in R descriptive statistics is the summary commands with single value results.<\/p>\n<p><em><strong>Take a deep insight into <a href=\"https:\/\/data-flair.training\/blogs\/r-vector-functions\/\">R Vector Functions<\/a><\/strong><\/em><\/p>\n<h3>Summary Commands with Single Value Results in R<\/h3>\n<p>There are many such commands that produce a single value as output. Let us see a few of them:<\/p>\n<ul>\n<li><strong>max(x, na.rm = FALSE) &#8211;<\/strong> It shows the maximum value. By default, NA values are not removed. NA is considered the largest unless <em>na.rm=true<\/em> is used.<\/li>\n<li><strong>min(x, na.rm = FALSE) \u2013<\/strong>\u00a0Shows minimum value in a vector. If there are na values, NA is returned unless <em>na.rm=true<\/em> is used.<\/li>\n<li><strong>length(x) \u2013<\/strong> Gives length of the vector and includes na values. <em>Na.rm=instruction<\/em> does not work with this command.<\/li>\n<li><strong>sum(x, na.rm = FALSE) &#8211;<\/strong> Shows the sum of the vector elements.<\/li>\n<li><strong>mean(x, na.rm = FALSE) &#8211;<\/strong>\u00a0We obtain an arithmetic mean with this.<\/li>\n<li><strong>median( x, na.rm = FALSE) &#8211;<\/strong> Shows the median value of the vector.<\/li>\n<li><strong>sd(x, na.rm = FALSE) &#8211;<\/strong> Shows the standard deviation.<\/li>\n<li><strong>var(x, na.rm = FALSE) &#8211;<\/strong> Shows the variance.<\/li>\n<li><strong>mad(x, na.rm = FALSE) &#8211;<\/strong> Shows the median absolute deviation.<\/li>\n<\/ul>\n<p>Various commands operate on the vector of values to return a simple result; however, if NA items are present, the final value will also be NA. For most commands, you can ensure that any NA items are ignored by adding the<em> na.rm = TRUE<\/em> instruction to the command. Now you get a \u201c<strong>proper<\/strong>\u201d result.<\/p>\n<p><strong>Note: <\/strong>Many summarizing commands use the <em>na.rm<\/em> instruction to drop NA items from the summary, however, this is not universal. The <em>length()<\/em> command, for example, does not use na.rm<\/p>\n<h3>R Summary Commands Producing Multiple Results<\/h3>\n<p>We have seen command producing a single output. Let us now see command producing many outputs.<\/p>\n<p>Below are few such commands:<\/p>\n<p><strong>log(dataset) &#8211;<\/strong>\u00a0Shows log value for each element.<br \/>\n<strong>summary(dataset) &#8211;<\/strong>\u00a0We have seen how it shows a summary of dataset like<em> maximum value, minimum value, mean,<\/em> etc.<br \/>\n<strong>quantile() &#8211;<\/strong>\u00a0Shows the quantiles by default\u2014the <em>0%, 25%, 50%, 75%, and 100% quantiles<\/em>. You can select other quantiles also.<\/p>\n<p>The <em>quantile()<\/em> command produces multiple results by default. One can alter the default result to produce quantiles for a single probability or several (in any order). The names of the quantiles selected are displayed as percentage labels. You can suppress this by using name<em> = FALSE<\/em> instruction. If the data contains NA items, you must remove them using the <em>na.rm = TRUE<\/em> instruction, otherwise, you get an error message.<\/p>\n<p>The command allows other instructions as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">quantile(x, probs = seq(0, 1, 0.25), na.rm = FALSE, names = TRUE)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/quantile.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-63807\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/quantile.png\" alt=\"quantile - Descriptive Statistics in R\" width=\"1298\" height=\"736\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/quantile.png 1298w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/quantile-150x85.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/quantile-300x170.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/quantile-768x435.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/quantile-1024x581.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/quantile-520x295.png 520w\" sizes=\"auto, (max-width: 1298px) 100vw, 1298px\" \/><\/a><\/p>\n<p>X in the command is the data object you wish to examine.<\/p>\n<p>The <em>probs = instruction<\/em> enables you to select one or several quantiles to display, defaulting to 0, 0.25, and so on. This is what the seq(0, 1, 0.25) command is doing: Setting a start of 0, an end of 1, and a step of 0.25. This is the same as c(0, 0.25, 0.5, 0.75, 1). The <em>names = instruction<\/em> tells R if it should display the name of the quantiles produced.<\/p>\n<p><em><strong>Explore major functions to organise your data in<a href=\"https:\/\/data-flair.training\/blogs\/r-data-reshaping-function-package\/\"> R Data Reshaping Tutorial<\/a><\/strong><\/em><\/p>\n<h3>R Cumulative Statistics<\/h3>\n<p>Cumulative statistics in <a href=\"https:\/\/en.wikipedia.org\/wiki\/R_(programming_language)\">R<\/a> is applied sequentially to a series of values. It is used to track the interest received on an investment.<\/p>\n<p>When data involves interest payments received then the cumulative sum would be a running total that includes the interest part of each payment. The commands that calculate cumulative statistics are of two types:<\/p>\n<ul>\n<li><strong>Simple Cumulative Commands \u2013<\/strong>\u00a0Need only\u00a0the name of the object.<\/li>\n<li><strong>Complex Cumulative Commands &#8211;<\/strong> Should be used in combination with other commands to produce more useful results.<\/li>\n<\/ul>\n<p>Any queries in R descriptive statistics concept till now? Share your doubts in the comment section below.<\/p>\n<h3>Simple Cumulative Commands in R<\/h3>\n<p>These are the commands that need only the name of the object. Cumulative commands produce an accurate result when applied to a vector of character data. However, if applied on character data, they give error populated as a list of NA items.<\/p>\n<p>If the numeric vector contains NA, the cumulative command will work till first NA and thereafter give all result as NA.<\/p>\n<p>Below are some commands that return cumulative values:<\/p>\n<ul>\n<li><strong>Cumsum(x) &#8211;<\/strong> The cumulative sum of a vector.<\/li>\n<li><strong>Cummax(x) &#8211;<\/strong> The cumulative maximum value.<\/li>\n<li><strong>Cumin(x) &#8211;<\/strong> The cumulative minimum value.<\/li>\n<li><strong>Cumprod(x) &#8211;<\/strong> The cumulative product.<\/li>\n<\/ul>\n<p>Let us see this with an example:<\/p>\n<p><span style=\"font-weight: 400\">A <\/span><span style=\"font-weight: 400\">vec<\/span><span style=\"font-weight: 400\"> is a vector comprising of values <em>3, 5, 7, 5, 3, 2 and 6.<\/em> In order to find its cumulative sum:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; #Author DataFlair\r\n&gt; vec = c(3,5,7,5,3,2,6)  #Creating vector\r\n&gt; cumsum(vec)\r\n&gt; cummax(vec)\r\n&gt; cummin(vec)\r\n&gt; cumprod(vec)\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/vecc-creating-vector.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-63808\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/vecc-creating-vector.png\" alt=\"vec=c creating vector\" width=\"1297\" height=\"738\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/vecc-creating-vector.png 1297w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/vecc-creating-vector-150x85.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/vecc-creating-vector-300x171.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/vecc-creating-vector-768x437.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/vecc-creating-vector-1024x583.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/vecc-creating-vector-520x296.png 520w\" sizes=\"auto, (max-width: 1297px) 100vw, 1297px\" \/><\/a><\/p>\n<p>Now, lets quickly jump to R complex cumulative commands in this R descriptive statistics tutorial.<\/p>\n<h3>R Complex Cumulative Commands<\/h3>\n<p>Cumulative commands should be used with other commands to produce additional useful results; for example,<em> the running mean.<\/em><\/p>\n<p>The basic arithmetic mean is the sum divided by the number of observations. You require the cumulative number of observations to obtain the cumulative sum.<\/p>\n<p>The<em> seq()<\/em> command can ease cumulative calculations. The index can be created from a sample of numeric values. The main purpose of the command is to generate sequences of values.<\/p>\n<p>Let us see the use of seq() command on data2 above.\u00a0We can also combine <em>cumsum() <\/em>and <em>seq() <\/em>command as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; #Author DataFlair\r\n&gt; seq(along=vec)\r\n&gt; cumsum(vec)\/seq(along = vec)\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/sec-alongvec.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-63809\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/sec-alongvec.png\" alt=\"sec along=vec\" width=\"1297\" height=\"730\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/sec-alongvec.png 1297w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/sec-alongvec-150x84.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/sec-alongvec-300x169.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/sec-alongvec-768x432.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/sec-alongvec-1024x576.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/sec-alongvec-520x293.png 520w\" sizes=\"auto, (max-width: 1297px) 100vw, 1297px\" \/><\/a><\/p>\n<p><em><strong>Wait! Have you checked &#8211; <a href=\"https:\/\/data-flair.training\/blogs\/r-numeric-and-character-functions\/\">Numeric and Character Functions in R<\/a><\/strong><\/em><\/p>\n<h3>Descriptive Statistics in R for Data Frames<\/h3>\n<p>Summarizing single vector of data is a simple and straight-forward process. You can directly apply the summarizing command to get results. However complicated data objects are demanding and require some amount of workaround.<\/p>\n<p>Let us see a few generic commands for data frames as below:<\/p>\n<ul>\n<li><strong>Max(frame) &#8211;<\/strong> Returns the largest value in the entire data frame.<\/li>\n<li><strong>Min(frame) &#8211;<\/strong> Returns the smallest value in the entire data frame.<\/li>\n<li><strong>Sum(frame) &#8211;<\/strong> Returns the sum of the entire data frame.<\/li>\n<li><strong>Fivenum(frame) &#8211;<\/strong> Returns the Tukey summary values for the entire data frame.<\/li>\n<li><strong>Length(frame)-<\/strong> Returns the number of columns in the data frame.<\/li>\n<li><strong>Summary(frame) &#8211;<\/strong> Returns the summary for each column.<\/li>\n<\/ul>\n<p>You can extract a single vector from your data frame and perform a summary of some sort on it. This approach will not work for rows of data frames.<\/p>\n<h4>R Special Summary Commands<\/h4>\n<p>There are two types of special summary commands:<\/p>\n<ul>\n<li><strong>Row Summary Commands &#8211;<\/strong> Applied to work with row data. Two commands here are<em> rowmeans()<\/em> and <em>rowsums().<\/em><\/li>\n<li><strong>Column Summary Commands &#8211;<\/strong>\u00a0Also, applied to work with row data but the two commands here are<em> colmeans()<\/em> and <em>colsums().<\/em><\/li>\n<\/ul>\n<h4>R Row Summary Commands<\/h4>\n<p>The row summary commands in R work with row data. r<em>owmeans()<\/em> command gives the mean of values in the row while <em>rowsums()<\/em> command gives the sum of values in the row.<\/p>\n<p>Suppose that we have the dataframe that represents scores of a quiz that has five questions. Here, each student is represented in a row and each column denotes a question. There are two categories 1 and 0 that correspond to correct and incorrect respectively.<\/p>\n<table style=\"height: 356px\" width=\"405\">\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">Q1\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400\">Q2\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400\">Q3\u00a0<\/span><\/td>\n<td><span style=\"font-weight: 400\">Q4<\/span><\/td>\n<td><span style=\"font-weight: 400\">Q5<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">0<\/span><\/td>\n<td><span style=\"font-weight: 400\">0<\/span><\/td>\n<td><span style=\"font-weight: 400\">0<\/span><\/td>\n<td><span style=\"font-weight: 400\">1<\/span><\/td>\n<td><span style=\"font-weight: 400\">1<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">0<\/span><\/td>\n<td><span style=\"font-weight: 400\">1<\/span><\/td>\n<td><span style=\"font-weight: 400\">0<\/span><\/td>\n<td><span style=\"font-weight: 400\">1<\/span><\/td>\n<td><span style=\"font-weight: 400\">0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">0<\/span><\/td>\n<td><span style=\"font-weight: 400\">1<\/span><\/td>\n<td><span style=\"font-weight: 400\">0<\/span><\/td>\n<td><span style=\"font-weight: 400\">1<\/span><\/td>\n<td><span style=\"font-weight: 400\">1<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">0<\/span><\/td>\n<td><span style=\"font-weight: 400\">0<\/span><\/td>\n<td><span style=\"font-weight: 400\">1<\/span><\/td>\n<td><span style=\"font-weight: 400\">1<\/span><\/td>\n<td><span style=\"font-weight: 400\">0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">1<\/span><\/td>\n<td><span style=\"font-weight: 400\">1<\/span><\/td>\n<td><span style=\"font-weight: 400\">1<\/span><\/td>\n<td><span style=\"font-weight: 400\">1<\/span><\/td>\n<td><span style=\"font-weight: 400\">1<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">#Author DataFlair\r\n\r\nquiz &lt;- data.frame(\"q1\" = c(0, 0, 0, 0, 1),\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"q2\" = c(0, 1, 1, 0, 1),\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"q3\" = c(0, 0, 0, 1, 1),\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"q4\" = c(1, 1, 1, 1, 1),\r\n\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\"q5\" = c(1, 0, 1, 0, 1))\r\n\r\nrowMeans(quiz)\r\n\r\nrowSums(quiz)<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/quiz-data.frame_.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-63810\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/quiz-data.frame_.png\" alt=\"quiz data.frame\" width=\"1296\" height=\"735\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/quiz-data.frame_.png 1296w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/quiz-data.frame_-150x85.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/quiz-data.frame_-300x170.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/quiz-data.frame_-768x436.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/quiz-data.frame_-1024x581.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/quiz-data.frame_-520x295.png 520w\" sizes=\"auto, (max-width: 1296px) 100vw, 1296px\" \/><\/a><\/p>\n<p><em><strong>You must have a look at <a href=\"https:\/\/data-flair.training\/blogs\/r-data-frame\/\">R Data Frame Concept<\/a><\/strong><\/em><\/p>\n<h4>Column Summary Commands in R<\/h4>\n<p>These R commands work with column data.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; #Author DataFlair\r\n&gt; colMeans(quiz) \r\nq1 q2 q3 q4 q5 \r\n0.2 0.6 0.4 1.0 0.6 \r\n&gt; colSums(quiz)\r\nq1 q2 q3 q4 q5 \r\n1 3 2 5 3<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/colMeans-quiz.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-63811\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/colMeans-quiz.png\" alt=\"colMeans quiz\" width=\"1296\" height=\"735\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/colMeans-quiz.png 1296w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/colMeans-quiz-150x85.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/colMeans-quiz-300x170.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/colMeans-quiz-768x436.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/colMeans-quiz-1024x581.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/colMeans-quiz-520x295.png 520w\" sizes=\"auto, (max-width: 1296px) 100vw, 1296px\" \/><\/a><\/p>\n<h3>The apply() Command in R for Summaries<\/h3>\n<p><em>Colmeans()<\/em> and <em>rowsums()<\/em> commands are quick alternative to a more general command <em>apply()<\/em>.<\/p>\n<p><em>The apply() command enables applying a function to the rows or columns of a matrix or data frame.<\/em> Depending on what function you specify when using the apply command, you will get back either a vector or a matrix. The general form of the command is:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">apply(X, MARGIN, FUN, ...)<\/pre>\n<p>x specifies the matrix or data frame.<\/p>\n<p>MARGIN command uses either 1 or 2, where 1 is for rows and 2 is for columns. You replace the FUN part with your command (the function you want to apply).<\/p>\n<p>You can also add additional instructions if they are appropriate to the command\/function you are applying.<strong> For example &#8211;<\/strong>\u00a0You might add the <em>na.rm = TRUE<\/em> instruction as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; #Author DataFlair\r\n&gt; apply(quiz, 1, mean, na.rm = TRUE)\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/apply-quiz.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-63812\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/apply-quiz.png\" alt=\"apply quiz - Descriptive Statistics in R\" width=\"1299\" height=\"740\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/apply-quiz.png 1299w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/apply-quiz-150x85.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/apply-quiz-300x171.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/apply-quiz-768x438.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/apply-quiz-1024x583.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/apply-quiz-520x296.png 520w\" sizes=\"auto, (max-width: 1299px) 100vw, 1299px\" \/><\/a><\/p>\n<p><em><strong>Gain expertise in apply() and supply() functions from <a href=\"https:\/\/data-flair.training\/blogs\/r-matrix-functions\/\">R Matrix Functions Tutorial<\/a><\/strong><\/em><\/p>\n<h3>Descriptive Statistics in R for Matrix Objects<\/h3>\n<p><span style=\"font-weight: 400\">A matrix may look like a data frame but is not. In a matrix object, data split into rows and columns though it is a single vector.<\/span><\/p>\n<p><span style=\"font-weight: 400\">With data frame, you can use $ to extract data but you cannot extract parts of a matrix using $. You can use the square brackets to retrieve information of any row or column.<\/span><\/p>\n<p><span style=\"font-weight: 400\">In this section, we will create our matrix \u2018mat\u2019 of 5 rows and 6 columns as follows:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">mat &lt;- matrix(rnorm(30), nrow=5, ncol=6)\r\nmean(mat[,2])\r\nmean(mat[2,])\r\n<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/mat-matrix-mean-mat.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-63813\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/mat-matrix-mean-mat.png\" alt=\"mat matrix mean mat - Descriptive Statistics in R\" width=\"1297\" height=\"741\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/mat-matrix-mean-mat.png 1297w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/mat-matrix-mean-mat-150x86.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/mat-matrix-mean-mat-300x171.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/mat-matrix-mean-mat-768x439.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/mat-matrix-mean-mat-1024x585.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/mat-matrix-mean-mat-520x297.png 520w\" sizes=\"auto, (max-width: 1297px) 100vw, 1297px\" \/><\/a><\/p>\n<p><span style=\"font-weight: 400\">The first example returns the mean for the second column, while the next example returns the mean for the second row using <\/span><i><span style=\"font-weight: 400\">colmeans()<\/span><\/i><span style=\"font-weight: 400\"> and <\/span><i><span style=\"font-weight: 400\">rowsums()<\/span><\/i><span style=\"font-weight: 400\"> commands as the before one is also applicable to matrices.<\/span><\/p>\n<p><span style=\"font-weight: 400\">The apply() command also works equally well for a matrix as it does for data frame objects. An example of using apply() command for data frames is as follows:<\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&gt; apply(mat, 2, median)\r\n<\/pre>\n<p><span style=\"font-weight: 400\">In this case, we extract the median values for the columns of the matrix. Customizing of the result is also possible for specific elements of data.<\/span><\/p>\n<p><span style=\"font-weight: 400\">One can append the square brackets after the command for customizing the result for specific elements of data. <\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">apply(mat,1,median)[1:2]<\/pre>\n<p><strong>Output:<\/strong><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/apply-mat-median.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-63814\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/apply-mat-median.png\" alt=\"apply mat median\" width=\"1295\" height=\"739\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/apply-mat-median.png 1295w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/apply-mat-median-150x86.png 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/apply-mat-median-300x171.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/apply-mat-median-768x438.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/apply-mat-median-1024x584.png 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/apply-mat-median-520x297.png 520w\" sizes=\"auto, (max-width: 1295px) 100vw, 1295px\" \/><\/a><\/p>\n<h2>Summary<\/h2>\n<p>In this tutorial of R descriptive statistics, we understood its whole concept and also learned about different R commands covered under the descriptive statistics. We hope the examples used for implementing the commands was understandable to you.<\/p>\n<p><em><strong>Next topic that I would recommend you to complete is <a href=\"https:\/\/data-flair.training\/blogs\/r-contingency-tables\/\">Introduction to R Contingency Tables<\/a><\/strong><\/em><\/p>\n<p>If you found any difficulty in understanding the descriptive statistics in R, share your queries in the comment section below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article will provide you with a comprehensive explanation of the descriptive statistics in R programming also known as summary statistics. We will learn these R commands along with their use and implementation with&#46;&#46;&#46;<\/p>\n","protected":false},"author":6,"featured_media":65230,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51],"tags":[16682,20700,11228,11265,11266],"class_list":["post-2846","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r","tag-descriptive-statistics-in-r","tag-r-cumulative-statistics","tag-r-matrix-object","tag-r-summary-commands","tag-r-summary-statistics"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Descriptive Statistics in R - Complete Guide for aspiring Data Scientists! - DataFlair<\/title>\n<meta name=\"description\" content=\"Grasp the whole concept of descriptive statistics in R programming and its R commands with the help of implementation examples in a detailed manner.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/descriptive-statistics-in-r\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Descriptive Statistics in R - Complete Guide for aspiring Data Scientists! - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Grasp the whole concept of descriptive statistics in R programming and its R commands with the help of implementation examples in a detailed manner.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/descriptive-statistics-in-r\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-06-15T10:47:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-25T12:50:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/Descriptive-Statistics-in-R.png\" \/>\n\t<meta property=\"og:image:width\" content=\"801\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Descriptive Statistics in R - Complete Guide for aspiring Data Scientists! - DataFlair","description":"Grasp the whole concept of descriptive statistics in R programming and its R commands with the help of implementation examples in a detailed manner.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/descriptive-statistics-in-r\/","og_locale":"en_US","og_type":"article","og_title":"Descriptive Statistics in R - Complete Guide for aspiring Data Scientists! - DataFlair","og_description":"Grasp the whole concept of descriptive statistics in R programming and its R commands with the help of implementation examples in a detailed manner.","og_url":"https:\/\/data-flair.training\/blogs\/descriptive-statistics-in-r\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2017-06-15T10:47:15+00:00","article_modified_time":"2021-08-25T12:50:58+00:00","og_image":[{"width":801,"height":420,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/Descriptive-Statistics-in-R.png","type":"image\/png"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/descriptive-statistics-in-r\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/descriptive-statistics-in-r\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89"},"headline":"Descriptive Statistics in R &#8211; Complete Guide for aspiring Data Scientists!","datePublished":"2017-06-15T10:47:15+00:00","dateModified":"2021-08-25T12:50:58+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/descriptive-statistics-in-r\/"},"wordCount":2482,"commentCount":1,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/descriptive-statistics-in-r\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/Descriptive-Statistics-in-R.png","keywords":["Descriptive Statistics in R","R Cumulative Statistics","R matrix object","R summary commands","R summary statistics"],"articleSection":["R Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/descriptive-statistics-in-r\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/descriptive-statistics-in-r\/","url":"https:\/\/data-flair.training\/blogs\/descriptive-statistics-in-r\/","name":"Descriptive Statistics in R - Complete Guide for aspiring Data Scientists! - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/descriptive-statistics-in-r\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/descriptive-statistics-in-r\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/Descriptive-Statistics-in-R.png","datePublished":"2017-06-15T10:47:15+00:00","dateModified":"2021-08-25T12:50:58+00:00","description":"Grasp the whole concept of descriptive statistics in R programming and its R commands with the help of implementation examples in a detailed manner.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/descriptive-statistics-in-r\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/descriptive-statistics-in-r\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/descriptive-statistics-in-r\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/Descriptive-Statistics-in-R.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/06\/Descriptive-Statistics-in-R.png","width":801,"height":420,"caption":"Descriptive Statistics in R"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/descriptive-statistics-in-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"R Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/r\/"},{"@type":"ListItem","position":3,"name":"Descriptive Statistics in R &#8211; Complete Guide for aspiring Data Scientists!"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team provides industry-driven content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our expert educators focus on delivering value-packed, easy-to-follow resources for tech enthusiasts and professionals.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam2\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/2846","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=2846"}],"version-history":[{"count":12,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/2846\/revisions"}],"predecessor-version":[{"id":63806,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/2846\/revisions\/63806"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/65230"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=2846"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=2846"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=2846"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}