<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ksmzn</author_name>
  <author_url>https://blog.hatena.ne.jp/ksmzn/</author_url>
  <blog_title>DPA</blog_title>
  <blog_url>https://ksmzn.hatenablog.com/</blog_url>
  <categories>
    <anon>R</anon>
  </categories>
  <description>dplyrというかdbplyrというべきか Rでデータフレームを縦方向に結合するときは rbind か dplyr::bind_rows がよく使われる。 だが、dplyrでDBに接続しているとき、DBにあるデータを結合するときに上記の関数ではうまくいかない。 結論から述べると、dplyr::union を使えばOK。SQLのUNIONと同じなので覚えやすい。 dplyr::union_all もあり、SQLのUNION ALLと同じで、重複を削除しない。 また、dplyr::union は引数を2つしか取らないため、3つ以上のデータをUNIONしようとしても、最初の2つ以外は無視される。 こ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fksmzn.hatenablog.com%2Fentry%2Fdplyr_union&quot; title=&quot;dplyr でDBのデータをUNIONする - DPA&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>https://cdn.blog.st-hatena.com/images/theme/og-image-1500.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2017-11-07 10:00:00</published>
  <title>dplyr でDBのデータをUNIONする</title>
  <type>rich</type>
  <url>https://ksmzn.hatenablog.com/entry/dplyr_union</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
