{"id":278849,"date":"2016-04-22T13:50:02","date_gmt":"2016-04-22T09:50:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=278849"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=278849","title":{"rendered":"\u0410\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0432 dplyr"},"content":{"rendered":"<p>       <code>summarise()<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0438\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0432\u0435\u043a\u0442\u043e\u0440 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043e\u0434\u043d\u043e. \u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>summarise_each()<\/code> \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a <code>summarise()<\/code> \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0436\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438.<\/p>\n<p>  \u0426\u0435\u043b\u044c \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u2014 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 <code>summarise()<\/code> \u0438 <code>summarise_each()<\/code>, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0434\u0432\u0430 \u0444\u0430\u043a\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c:<\/p>\n<p>  1. \u0421\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u043f\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c   <\/p>\n<ul>\n<li>1\u0410, \u043e\u0434\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f<\/li>\n<li>1\u0412, \u0431\u043e\u043b\u0435\u0435 \u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439<\/li>\n<\/ul>\n<p>  2. \u0421\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043a \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439   <\/p>\n<ul>\n<li>2\u0410, \u043e\u0434\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f<\/li>\n<li>2\u0412, \u0431\u043e\u043b\u0435\u0435 \u043e\u0434\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/li>\n<\/ul>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0442\u044b\u0440\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430:  <\/p>\n<ul>\n<li>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 1: \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0434\u043d\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a \u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439<\/li>\n<li>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 2: \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a \u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439<\/li>\n<li>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 3: \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0434\u043d\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a \u043c\u043d\u043e\u0433\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c<\/li>\n<li>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 4: \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a \u043c\u043d\u043e\u0433\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c<\/li>\n<\/ul>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u044d\u0442\u0438 \u0447\u0435\u0442\u044b\u0440\u0435 \u0441\u043b\u0443\u0447\u0430\u044f \u0441 \u0438 \u0431\u0435\u0437 \u043e\u043f\u0446\u0438\u0438 <code>group_by()<\/code>.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041f\u0430\u043a\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 <code>mtcars<\/code><\/h4>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0445\u043e\u0440\u043e\u0448\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 <code>mtcars<\/code>.<\/p>\n<p>  \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u044b \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0435\u0433\u043e \u0432 \u043e\u0431\u044a\u0435\u043a\u0442 <code>tbl_df<\/code>. \u0421\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c <code>data.frame<\/code> \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442, \u0437\u0430\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0443\u0447\u0448\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432\u044b\u0432\u043e\u0434\u0430.<\/p>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0431\u044b\u043b\u043e \u043b\u0435\u0433\u043a\u043e \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f, \u0432\u044b\u0434\u0435\u043b\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0442\u044b\u0440\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c:  <\/p>\n<pre><code class=\"python\">mtcars &lt;- mtcars   %&gt;%    tbl_df() %&gt;%    select(cyl , mpg, disp) <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 1: \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0434\u043d\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a \u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439<\/h4>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>summarise()<\/code> \u0432\u044b\u0434\u0430\u0441\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:  <\/p>\n<pre><code class=\"python\"># \u0431\u0435\u0437 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 mtcars %&gt;%    summarise (mean_mpg = mean(mpg)) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"diff\">## Source: local data frame [1 x 1] ##  ##   mean_mpg ##      (dbl) ## 1 20.09062 <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0441 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u043e\u0439 mtcars %&gt;%    group_by(cyl) %&gt;%    summarise (mean_mpg = mean(mpg)) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"diff\">## Source: local data frame [3 x 2] ##  ##     cyl mean_mpg ##   (dbl)    (dbl) ## 1     4 26.66364 ## 2     6 19.74286 ## 3     8 15.10000 <\/code><\/pre>\n<p>  \u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>summarise_each()<\/code>, \u043d\u043e \u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u043d\u0435\u0435 \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u043e \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u043a\u043e\u0434\u0430.  <\/p>\n<pre><code class=\"python\"># \u0431\u0435\u0437 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 mtcars %&gt;%    summarise_each (funs(mean) , mean_mpg = mpg) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"diff\">## Source: local data frame [1 x 1] ##  ##   mean_mpg ##      (dbl) ## 1 20.09062 <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0441 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u043e\u0439 mtcars %&gt;%    group_by(cyl) %&gt;%    summarise_each (funs(mean) , mean_mpg = mpg) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"diff\">## Source: local data frame [3 x 2] ##  ##     cyl mean_mpg ##   (dbl)    (dbl) ## 1     4 26.66364 ## 2     6 19.74286 ## 3     8 15.10000 <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 2: \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a \u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439<\/h4>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0431\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0438 <code>summarise()<\/code>, \u0438 <code>summarise_each()<\/code>.<\/p>\n<p>  \u0423 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>summarise()<\/code> \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441:  <\/p>\n<pre><code class=\"python\"># \u0431\u0435\u0437 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 mtcars %&gt;%    summarise (min_mpg = min(mpg), max_mpg = max(mpg)) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"diff\">## Source: local data frame [1 x 2] ##  ##   min_mpg max_mpg ##     (dbl)   (dbl) ## 1    10.4    33.9 <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0441 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u043e\u0439 mtcars %&gt;%    group_by(cyl) %&gt;%    summarise (min_mpg = min(mpg), max_mpg = max(mpg)) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"diff\">## Source: local data frame [3 x 3] ##  ##     cyl min_mpg max_mpg ##   (dbl)   (dbl)   (dbl) ## 1     4    21.4    33.9 ## 2     6    17.8    21.4 ## 3     8    10.4    19.2 <\/code><\/pre>\n<p>  \u041c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445:  <\/p>\n<pre><code class=\"python\">max_mpg = max(mpg) <\/code><\/pre>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u043a \u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439, <code>summarise_each()<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0439 \u0438 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441:  <\/p>\n<pre><code class=\"python\"># \u0431\u0435\u0437 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 mtcars %&gt;%    summarise_each (funs(min, max), mpg) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"diff\">## Source: local data frame [1 x 2] ##  ##     min   max ##   (dbl) (dbl) ## 1  10.4  33.9 <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0441 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u043e\u0439 mtcars %&gt;%    group_by(cyl) %&gt;%    summarise_each (funs(min, max), mpg) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"diff\">## Source: local data frame [3 x 3] ##  ##     cyl   min   max ##   (dbl) (dbl) (dbl) ## 1     4  21.4  33.9 ## 2     6  17.8  21.4 ## 3     8  10.4  19.2 <\/code><\/pre>\n<p>  \u0418\u043c\u0435\u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439: <code>min<\/code> \u0438 <code>max<\/code>. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0442\u0435\u0440\u044f\u0435\u043c \u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f. \u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 <code>min_mpg<\/code> \u0438 <code>max_mpg<\/code>, \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c <b>\u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/b> \u0432\u043d\u0443\u0442\u0440\u0438 <code>funs()<\/code>:  <\/p>\n<pre><code class=\"python\"># \u0431\u0435\u0437 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 mtcars %&gt;%    summarise_each (funs(min_mpg = min, max_mpg = max), mpg) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"diff\">## Source: local data frame [1 x 2] ##  ##   min_mpg max_mpg ##     (dbl)   (dbl) ## 1    10.4    33.9 <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0441 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u043e\u0439 mtcars %&gt;%    group_by(cyl) %&gt;%    summarise_each (funs(min_mpg = min, max_mpg = max), mpg) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"diff\">## Source: local data frame [3 x 3] ##  ##     cyl min_mpg max_mpg ##   (dbl)   (dbl)   (dbl) ## 1     4    21.4    33.9 ## 2     6    17.8    21.4 ## 3     8    10.4    19.2 <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 3: \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0434\u043d\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a \u043c\u043d\u043e\u0433\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c<\/h4>\n<p>  \u042d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439. \u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0431\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438: \u0438 <code>summarise()<\/code>, \u0438 <code>summarise_each()<\/code>.<\/p>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>summarise()<\/code> \u0441\u043d\u043e\u0432\u0430 \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u0438 \u0438\u043c\u0435\u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u0435:   <\/p>\n<pre><code class=\"python\">max_mpg = max(mpg) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0431\u0435\u0437 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 mtcars %&gt;%    summarise(mean_mpg = mean(mpg), mean_disp = mean(disp)) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"diff\">## Source: local data frame [1 x 2] ##  ##   mean_mpg mean_disp ##      (dbl)     (dbl) ## 1 20.09062  230.7219 <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0441 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u043e\u0439 mtcars %&gt;%    group_by(cyl) %&gt;%    summarise(mean_mpg = mean(mpg), mean_disp = mean(disp)) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"diff\">## Source: local data frame [3 x 3] ##  ##     cyl mean_mpg mean_disp ##   (dbl)    (dbl)     (dbl) ## 1     4 26.66364  105.1364 ## 2     6 19.74286  183.3143 ## 3     8 15.10000  353.1000 <\/code><\/pre>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u043a\u043e \u043c\u043d\u043e\u0433\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, <code>summarise_each()<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0439 \u0438 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441:  <\/p>\n<pre><code class=\"python\"># \u0431\u0435\u0437 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 mtcars %&gt;%    summarise_each(funs(mean) , mpg, disp) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"diff\">## Source: local data frame [1 x 2] ##  ##        mpg     disp ##      (dbl)    (dbl) ## 1 20.09062 230.7219 <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0441 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u043e\u0439 mtcars %&gt;%    group_by(cyl) %&gt;%    summarise_each (funs(mean), mpg, disp) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"diff\">## Source: local data frame [3 x 3] ##  ##     cyl      mpg     disp ##   (dbl)    (dbl)    (dbl) ## 1     4 26.66364 105.1364 ## 2     6 19.74286 183.3143 ## 3     8 15.10000 353.1000 <\/code><\/pre>\n<p>  \u0418\u043c\u0435\u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u0430\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445: <code>mpg<\/code> \u0438 <code>disp<\/code>. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0442\u0435\u0440\u044f\u0435\u043c \u0438\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u043d\u043e\u0439 \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u2014 <code>mean()<\/code>. \u0412\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 <code>mean_mpg<\/code> \u0438 <code>mean_disp<\/code>. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0438\u0447\u044c, \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c <b>\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435<\/b>, \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0432 &quot;&#8230;&quot; \u0432\u043d\u0443\u0442\u0440\u0438 <code>summarise_each()<\/code>:  <\/p>\n<pre><code class=\"python\"># \u0431\u0435\u0437 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 mtcars %&gt;%    summarise_each(funs(mean) , mean_mpg = mpg, mean_disp = disp) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"diff\">## Source: local data frame [1 x 2] ##  ##   mean_mpg mean_disp ##      (dbl)     (dbl) ## 1 20.09062  230.7219 <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0441 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u043e\u0439 mtcars %&gt;%    group_by(cyl) %&gt;%    summarise_each(funs(mean) , mean_mpg = mpg, mean_disp = disp) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"diff\">## Source: local data frame [3 x 3] ##  ##     cyl mean_mpg mean_disp ##   (dbl)    (dbl)     (dbl) ## 1     4 26.66364  105.1364 ## 2     6 19.74286  183.3143 ## 3     8 15.10000  353.1000 <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 4: \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a \u043c\u043d\u043e\u0433\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c<\/h4>\n<p>  \u041a\u0430\u043a \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445, \u043e\u0431\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0438 <code>summarise()<\/code>, \u0438 <code>summarise_each()<\/code>, \u0438\u043c\u0435\u044e\u0442 \u0441\u0432\u043e\u0438 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430.<\/p>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>summarise()<\/code> \u0441\u043d\u043e\u0432\u0430 \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u0438 \u0438\u043c\u0435\u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u0435:   <\/p>\n<pre><code class=\"python\">max_mpg = max(mpg) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0431\u0435\u0437 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 mtcars %&gt;%    summarise(min_mpg = min(mpg) , min_disp = min(disp), max_mpg = max(mpg) , max_disp = max(disp)) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"diff\">## Source: local data frame [1 x 4] ##  ##   min_mpg min_disp max_mpg max_disp ##     (dbl)    (dbl)   (dbl)    (dbl) ## 1    10.4     71.1    33.9      472 <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0441 \u043e\u0434\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u043e\u0439 mtcars %&gt;%    group_by(cyl) %&gt;%    summarise(min_mpg = min(mpg) , min_disp = min(disp), max_mpg = max(mpg) , max_disp = max(disp)) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"diff\">## Source: local data frame [3 x 5] ##  ##     cyl min_mpg min_disp max_mpg max_disp ##   (dbl)   (dbl)    (dbl)   (dbl)    (dbl) ## 1     4    21.4     71.1    33.9    146.7 ## 2     6    17.8    145.0    21.4    258.0 ## 3     8    10.4    275.8    19.2    472.0 <\/code><\/pre>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u043a\u043e \u043c\u043d\u043e\u0433\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439, <code>summarise_each()<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0439 \u0438 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441:  <\/p>\n<pre><code class=\"python\"># \u0431\u0435\u0437 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 mtcars %&gt;%    summarise_each(funs(min, max) , mpg, disp) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"diff\">## Source: local data frame [1 x 4] ##  ##   mpg_min disp_min mpg_max disp_max ##     (dbl)    (dbl)   (dbl)    (dbl) ## 1    10.4     71.1    33.9      472 <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0441 \u043e\u0434\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u043e\u0439 mtcars %&gt;%    group_by(cyl) %&gt;%    summarise_each(funs(min, max) , mpg, disp) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"diff\">## Source: local data frame [3 x 5] ##  ##     cyl mpg_min disp_min mpg_max disp_max ##   (dbl)   (dbl)    (dbl)   (dbl)    (dbl) ## 1     4    21.4     71.1    33.9    146.7 ## 2     6    17.8    145.0    21.4    258.0 ## 3     8    10.4    275.8    19.2    472.0 <\/code><\/pre>\n<p>  \u0418\u043c\u0435\u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0442\u0430\u043a: <code>variable_function<\/code>, \u0442.\u0435. <code>mpg_min<\/code>, <code>disp_min<\/code> \u0438 \u0442.\u0434.<\/p>\n<p>  \u041e\u0431\u0440\u0430\u0442\u043d\u043e\u0435 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445, \u0442.\u0435. <code>function_variable<\/code>, \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 <code>summarise_each()<\/code>. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b.  <\/p>\n<pre><code class=\"python\"># \u0431\u0435\u0437 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 mtcars %&gt;%    summarise_each(funs(min, max) , mpg, disp) %&gt;%   setNames(c(&quot;min_mpg&quot;, &quot;min_disp&quot;, &quot;max_mpg&quot;, &quot;max_disp&quot;)) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"diff\">## Source: local data frame [1 x 4] ##  ##   min_mpg min_disp max_mpg max_disp ##     (dbl)    (dbl)   (dbl)    (dbl) ## 1    10.4     71.1    33.9      472 <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\"># \u0441 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u043e\u0439 mtcars %&gt;%    group_by(cyl) %&gt;%    summarise_each(funs(min, max) , mpg, disp) %&gt;%   setNames(c(&quot;gear&quot;, &quot;min_mpg&quot;, &quot;min_disp&quot;, &quot;max_mpg&quot;, &quot;max_disp&quot;)) <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"diff\">## Source: local data frame [3 x 5] ##  ##    gear min_mpg min_disp max_mpg max_disp ##   (dbl)   (dbl)    (dbl)   (dbl)    (dbl) ## 1     4    21.4     71.1    33.9    146.7 ## 2     6    17.8    145.0    21.4    258.0 ## 3     8    10.4    275.8    19.2    472.0 <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0412\u044b\u0432\u043e\u0434\u044b<\/h4>\n<p>  \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b, \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043a\u0430\u043d\u0434\u0438\u0434\u0430\u0442\u0430:  <\/p>\n<ul>\n<li><code>summarise()<\/code><\/li>\n<li><code>summarise_each()<\/code><\/li>\n<\/ul>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>summarise()<\/code> \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>summarise_each()<\/code> \u2014 \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0439.<\/p>\n<p>  \u0412\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u044d\u0442\u043e\u0433\u043e, <code>summarise()<\/code> \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0427\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0442\u0435\u043c \u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 <code>summarise_each()<\/code>.<\/p>\n<p>  \u0423 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>summarise_each()<\/code> \u0441\u0432\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445:<\/p>\n<h5>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 2: \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a \u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439<\/h5>\n<p>  \u0418\u043c\u0435\u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u0430\u043c\u0438 <b>\u0444\u0443\u043d\u043a\u0446\u0438\u0439<\/b>. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0442\u0435\u0440\u044f\u0435\u043c \u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438.<\/p>\n<h5>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 3: \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0434\u043d\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a \u043c\u043d\u043e\u0433\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c<\/h5>\n<p>  \u0418\u043c\u0435\u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u0430\u043c\u0438 <b>\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445<\/b>. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u044b \u0442\u0435\u0440\u044f\u0435\u043c \u0438\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u043e\u0439 \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c.<\/p>\n<h5>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 4: \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a \u043c\u043d\u043e\u0433\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c<\/h5>\n<p>  \u0418\u043c\u0435\u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u043e\u0442\u0430\u0446\u0438\u0435\u0439 <b>variable_function<\/b>. \u0412\u043d\u0443\u0442\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0430 <code>summarise_each()<\/code> \u0434\u0440\u0443\u0433\u043e\u0435 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e.       <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/281747\/\"> https:\/\/habrahabr.ru\/post\/281747\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       <code>summarise()<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u044e\u0449\u0438\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0432\u0435\u043a\u0442\u043e\u0440 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043e\u0434\u043d\u043e. \u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>summarise_each()<\/code> \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a <code>summarise()<\/code> \u0441 \u0442\u0430\u043a\u0438\u043c\u0438 \u0436\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438.<\/p>\n<p>  \u0426\u0435\u043b\u044c \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u2014 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 <code>summarise()<\/code> \u0438 <code>summarise_each()<\/code>, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u0434\u0432\u0430 \u0444\u0430\u043a\u0442\u043e\u0440\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c:<\/p>\n<p>  1. \u0421\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u043e\u043f\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c   <\/p>\n<ul>\n<li>1\u0410, \u043e\u0434\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f<\/li>\n<li>1\u0412, \u0431\u043e\u043b\u0435\u0435 \u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439<\/li>\n<\/ul>\n<p>  2. \u0421\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u043a \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439   <\/p>\n<ul>\n<li>2\u0410, \u043e\u0434\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f<\/li>\n<li>2\u0412, \u0431\u043e\u043b\u0435\u0435 \u043e\u0434\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/li>\n<\/ul>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0442\u044b\u0440\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430:  <\/p>\n<ul>\n<li>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 1: \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0434\u043d\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a \u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439<\/li>\n<li>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 2: \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a \u043e\u0434\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439<\/li>\n<li>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 3: \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0434\u043d\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043a \u043c\u043d\u043e\u0433\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c<\/li>\n<li>\u0412\u0430\u0440\u0438\u0430\u043d\u0442 4: \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a \u043c\u043d\u043e\u0433\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c<\/li>\n<\/ul>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u044d\u0442\u0438 \u0447\u0435\u0442\u044b\u0440\u0435 \u0441\u043b\u0443\u0447\u0430\u044f \u0441 \u0438 \u0431\u0435\u0437 \u043e\u043f\u0446\u0438\u0438 <code>group_by()<\/code>.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-278849","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/278849","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=278849"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/278849\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=278849"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=278849"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=278849"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}