<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>uncorrelated</author_name>
  <author_url>https://blog.hatena.ne.jp/uncorrelated/</author_url>
  <blog_title> 餡子付゛録゛</blog_title>
  <blog_url>https://uncorrelated.hatenablog.com/</blog_url>
  <categories>
    <anon>R言語</anon>
  </categories>
  <description>ツイッターで見かけた御題なのですが、（学校の課題などで）ありそうなので、置いておきます。 # お試しデータを作る set.seed(20150208) n &lt;- 30 df &lt;- data.frame(type=c(&quot;A&quot;, &quot;B&quot;, &quot;C&quot;)[round(runif(n, min=0.5, max=3.5))], value=60 - ((1:n)-10)^2)# タイプごとに最大値を求める tapply(df$value, df$type, max)# 2番目の値を求める tapply(df$value, df$type, function(x){ # 降順ソートをして2番目を返す # 最…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Funcorrelated.hatenablog.com%2Fentry%2F20150208%2F1423402647&quot; title=&quot;Rで各集団における大きい方から2番目の値を調べる -  餡子付゛録゛&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>2015-02-08 22:37:27</published>
  <title>Rで各集団における大きい方から2番目の値を調べる</title>
  <type>rich</type>
  <url>https://uncorrelated.hatenablog.com/entry/20150208/1423402647</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
