<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>potisan</author_name>
  <author_url>https://blog.hatena.ne.jp/potisan/</author_url>
  <blog_title>potisanのプログラミングメモ</blog_title>
  <blog_url>https://potisan-programming-memo.hatenablog.jp/</blog_url>
  <categories>
    <anon>R</anon>
    <anon>tidyverse</anon>
    <anon>まとめ未登録（管理用）</anon>
  </categories>
  <description>Rとtidyverse 1.3.1でtibbleに条件分岐で列を追加するサンプルコードです。case_whenは%&gt;% case_when(条件式~値, ...)の形式で条件を満たす値を返します。最後のTRUE~NA_real_はどの条件にも一致しない要素の値を指定しています。NA_real_がNAではないのはcase_whenは右辺値（「~」の右側）の型統一を求めるためです。 library(tidyverse) #tidyverse 1.3.1 data &lt;- tibble(A=c(1:5, 11:15, 21:25, 100)) #列名が直書きできる場合 data %&gt;% mutate(…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpotisan-programming-memo.hatenablog.jp%2Fentry%2F2022%2F04%2F02%2F010406&quot; title=&quot;R&amp;amp;tidyverse tibbleに条件分岐で列を追加する - potisanのプログラミングメモ&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>2022-04-02 01:04:06</published>
  <title>R&amp;tidyverse tibbleに条件分岐で列を追加する</title>
  <type>rich</type>
  <url>https://potisan-programming-memo.hatenablog.jp/entry/2022/04/02/010406</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
