<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>syou6162</author_name>
  <author_url>https://blog.hatena.ne.jp/syou6162/</author_url>
  <blog_title>yasuhisa's blog</blog_title>
  <blog_url>https://www.yasuhisay.info/</blog_url>
  <categories>
    <anon>R</anon>
  </categories>
  <description>実は、RでK近傍法を用いたクラス分類をするためのコードを書いてみた - yasuhisa's blogのやつは小さな正方形に区間をくぎって、そこでぬりつぶす、という作業をやっています。Rでぬりつぶし、といったらpolygon関数なんですが、あんまり使い方覚えてないので、書いておく。下の例だと1から10までの平面を考えて、x*yが20を越えてるところをぬりつぶすというのをやっています(整数限定で)。ぬりつぶすために、左下、右下、右上、左上という順番で動いているのがポイントです。 plot(1:10,1:10,type=&quot;n&quot;) s &lt;- seq(1,10,length.out=10) for(i…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fwww.yasuhisay.info%2Fentry%2F20081017%2F1224256411&quot; title=&quot;polygon関数で正方形を塗りつぶす - yasuhisa&amp;#39;s blog&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-ak.f.st-hatena.com/images/fotolife/s/syou6162/20161103/20161103182051.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2008-10-17 00:13:31</published>
  <title>polygon関数で正方形を塗りつぶす</title>
  <type>rich</type>
  <url>https://www.yasuhisay.info/entry/20081017/1224256411</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
