<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>chito_ng</author_name>
  <author_url>https://blog.hatena.ne.jp/chito_ng/</author_url>
  <blog_title>まずは蝋の翼から。</blog_title>
  <blog_url>https://knknkn.hatenablog.com/</blog_url>
  <categories>
    <anon>R</anon>
    <anon>使い方メモ(ライブラリ)</anon>
  </categories>
  <description>dplyr1.0.0から追加されるacrossで条件に当てはまる列に対して個別に集約関数の適用ができるようになった。 今までもsummarise_atでもできたがこの場合は1条件にしか適用できなかったが、acrossでは複数条件での適用が可能。 例 summarise_atではSepalで始まる場合はmean、Petalで始まる場合はsumを適用している。まとめて1回ではできないので2回に分けるか、summarise_allでまとめて出す必要がある。 iris %&gt;% group_by(Species) %&gt;% summarise_at(vars(starts_with(&quot;Sepal&quot;)), …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fknknkn.hatenablog.com%2Fentry%2F2020%2F04%2F12%2F170636&quot; title=&quot;acrossを用いて、Rで列ごとに別の集約関数をまとめて適応させる - まずは蝋の翼から。&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2020-04-12 17:06:36</published>
  <title>acrossを用いて、Rで列ごとに別の集約関数をまとめて適応させる</title>
  <type>rich</type>
  <url>https://knknkn.hatenablog.com/entry/2020/04/12/170636</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
