<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>hiratake55</author_name>
  <author_url>https://blog.hatena.ne.jp/hiratake55/</author_url>
  <blog_title>hiratake55 の作業メモ</blog_title>
  <blog_url>https://hiratake55.hatenadiary.jp/</blog_url>
  <categories>
    <anon>R</anon>
  </categories>
  <description>まあ知ってる人は知ってると思うけど、今さら知ったので覚書。 R では、ifelse 関数が、3 項演算子と同じように使えますね。Excel の IF 関数のように使います。 使い方と使用例 &gt; ## 文法 &gt; ifelse(条件式, 真の場合, 偽の場合) &gt; score&lt;-40 &gt; ifelse(score&gt;=60,&quot;合格&quot;,&quot;不合格&quot;) [1] &quot;不合格&quot; &gt; score&lt;-80 &gt; ifelse(score&gt;=60,&quot;合格&quot;,&quot;不合格&quot;) [1] &quot;合格&quot; &gt; reply&lt;-NULL &gt; for(i in 1:40){ reply[i]&lt;-ifelse(i%%3==0 || substr…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhiratake55.hatenadiary.jp%2Fentry%2F20090507%2F1241699360&quot; title=&quot;R の三項演算子 - hiratake55 の作業メモ&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>http://ecx.images-amazon.com/images/I/51ywF2gawpL.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2009-05-07 21:29:20</published>
  <title>R の三項演算子</title>
  <type>rich</type>
  <url>https://hiratake55.hatenadiary.jp/entry/20090507/1241699360</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
