{"id":2733,"date":"2024-10-03T23:18:25","date_gmt":"2024-10-03T14:18:25","guid":{"rendered":"https:\/\/secondlife.lol\/?p=2733"},"modified":"2024-09-29T23:36:56","modified_gmt":"2024-09-29T14:36:56","slug":"learn-baseball-rules-with-r-modern-visualization","status":"publish","type":"post","link":"https:\/\/secondlife.lol\/ja\/learn-baseball-rules-with-r-modern-visualization\/","title":{"rendered":"\u30a2\u30a6\u30c8\u30ab\u30a6\u30f3\u30c8\u306a\u3069\u91ce\u7403\u306e\u30eb\u30fc\u30eb\uff1aR\u3092\u5229\u7528\u3057\u305f\u8996\u899a\u5316\u3067\u7c21\u5358\u306b\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b"},"content":{"rendered":"<p>\u91ce\u7403\u306e\u30eb\u30fc\u30eb\u306f\u8907\u96d1\u3067\u96e3\u3057\u3044\u3068\u601d\u3044\u307e\u3059\u304b\uff1f \u3067\u306f\u4eca\u56de\u306f <strong>R<\/strong>\u3092\u4f7f\u7528\u3057\u3066\u3001\u30c7\u30fc\u30bf\u306b\u57fa\u3065\u3044\u305f\u30d3\u30b8\u30e5\u30a2\u30e9\u30a4\u30bc\u30fc\u30b7\u30e7\u30f3\u3092\u901a\u3058\u3066\u3001\u91ce\u7403\u306e\u4e3b\u306a\u30eb\u30fc\u30eb\u3092\u8996\u899a\u7684\u306b\u8aac\u660e\u3057\u307e\u3059\u3002 \u91ce\u7403\u306f\u30eb\u30fc\u30eb\u3092\u7406\u89e3\u3059\u308b\u3060\u3051\u3067\u3001\u3088\u308a\u697d\u3057\u304f\u697d\u3057\u3081\u308b\u30b9\u30dd\u30fc\u30c4\u3067\u3059\u3002 \u4eca\u56de\u306e\u8a18\u4e8b\u3067\u306f <strong>R\u3067\u5b66\u3076\u91ce\u7403\u306e\u30eb\u30fc\u30eb\u3092\u30c6\u30fc\u30de\u306b\u3001\u30c7\u30fc\u30bf\u3092\u53ef\u8996\u5316\u3057\u3066\u8907\u96d1\u306a\u30eb\u30fc\u30eb\u3092\u7c21\u5358\u306b\u8aac\u660e\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/strong>\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n<style>.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap{padding-top:var(--global-kb-spacing-sm, 1.5rem);padding-right:var(--global-kb-spacing-sm, 1.5rem);padding-bottom:var(--global-kb-spacing-sm, 1.5rem);padding-left:var(--global-kb-spacing-sm, 1.5rem);border-top:3px solid var(--global-palette2, #2B6CB0);border-right:3px solid var(--global-palette2, #2B6CB0);border-bottom:3px solid var(--global-palette2, #2B6CB0);border-left:3px solid var(--global-palette2, #2B6CB0);border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title-wrap{padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title-wrap{color:var(--global-palette2, #2B6CB0);}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title{color:var(--global-palette2, #2B6CB0);font-size:28px;font-weight:regular;font-style:normal;}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap .kb-table-of-content-list{color:var(--global-palette1, #3182CE);line-height:2em;font-weight:regular;font-style:normal;margin-top:var(--global-kb-spacing-sm, 1.5rem);margin-right:0px;margin-bottom:0px;margin-left:0px;}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap .kb-table-of-content-list .kb-table-of-contents__entry:hover{color:var(--global-palette6, #718096);}@media all and (max-width: 1024px){.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap{border-top:3px solid var(--global-palette2, #2B6CB0);border-right:3px solid var(--global-palette2, #2B6CB0);border-bottom:3px solid var(--global-palette2, #2B6CB0);border-left:3px solid var(--global-palette2, #2B6CB0);}}@media all and (max-width: 1024px){.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title{font-size:28px;}}@media all and (max-width: 767px){.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap{border-top:3px solid var(--global-palette2, #2B6CB0);border-right:3px solid var(--global-palette2, #2B6CB0);border-bottom:3px solid var(--global-palette2, #2B6CB0);border-left:3px solid var(--global-palette2, #2B6CB0);}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title{font-size:28px;}}<\/style>\n\n\n<h3 class=\"wp-block-heading\">\u30a2\u30a6\u30c8\u30ab\u30a6\u30f3\u30c8\u30eb\u30fc\u30eb\uff1a3\u56de\u306e\u30c1\u30e3\u30f3\u30b9\u3001\u8996\u899a\u7684\u306a\u8868\u793a<\/h3>\n\n\n\n<p>\u91ce\u7403\u306e\u6700\u3082\u57fa\u672c\u7684\u306a\u30eb\u30fc\u30eb\u306e\u3072\u3068\u3064\u306f <strong>\u30a2\u30a6\u30c8\u30ab\u30a6\u30f3\u30c8<\/strong>\u3067\u3059\u3002\u653b\u5b88(\u653b\u6483\u3068\u5b88\u5099)\u3092\u4ea4\u4e92\u306b\u884c\u3046\u306b\u306f3\u56de\u306e\u30a2\u30a6\u30c8\u304c\u5fc5\u8981\u3067\u3059\u3002\u3053\u306e\u30a2\u30a6\u30c8\u30ab\u30a6\u30f3\u30c8\u3092R\u3092\u4f7f\u3063\u3066\u30c8\u30ec\u30f3\u30c7\u30a3\u306b\u8996\u899a\u5316\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n<style>.kb-image2733_181730-8e .kb-image-has-overlay:after{opacity:0.3;border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;}.kb-image2733_181730-8e img.kb-img, .kb-image2733_181730-8e .kb-img img{border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}<\/style>\n<div class=\"wp-block-kadence-image kb-image2733_181730-8e\"><figure class=\"aligncenter size-medium_large\"><img decoding=\"async\" width=\"768\" height=\"398\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/09\/image-7-11-768x398.jpg\" alt=\"\uc57c\uad6c \uaddc\uce59 - \uc544\uc6c3 \uce74\uc6b4\ud2b8 \uadf8\ub9bc\" class=\"kb-img wp-image-2734\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/09\/image-7-11-768x398.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/09\/image-7-11-300x155.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/09\/image-7-11-600x311.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/09\/image-7-11.jpg 1184w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/figure><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code># R\u30b3\u30fc\u30c9\uff1a\u30c8\u30ec\u30f3\u30c7\u30a3\u306a\u30a2\u30a6\u30c8\u30ab\u30a6\u30f3\u30c8\u306e\u53ef\u8996\u5316\nlibrary(ggplot2)\n\n# \u30c7\u30fc\u30bf\u306e\u751f\u6210: \u5404\u30a2\u30a6\u30c8\u30ab\u30a6\u30f3\u30c8\u306e\u8aac\u660e\u3068\u30ab\u30a6\u30f3\u30c8\u6570\nouts &lt;- data.frame(\n  situation = factor(c(&quot;1 out&quot;, &quot;2 out&quot;, &quot;3 out&quot;), levels = c(&quot;1 out&quot;, &quot;2 out&quot;, &quot;3 out&quot;))\u3001\n  count = c(1, 2, 3)\n)\n\n#\u306e\u53ef\u8996\u5316\u751f\u6210\nggplot(outs, aes(x = situation, y = count, fill = situation)) +\n  geom_col(width = 0.6, show.legend = FALSE) + # \u73fe\u4ee3\u7684\u306a\u611f\u3058\u306e\u68d2\u30b0\u30e9\u30d5\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\n  geom_text(aes(label = count), vjust = -0.5, size = 5, color = &quot;white&quot;, fontface = &quot;bold&quot;) + # \u30d0\u30fc\u4e0a\u306b\u30c6\u30ad\u30b9\u30c8\u3092\u8868\u793a\u3059\u308b\n  scale_fill_manual(values = c(&quot;#00aaff&quot;, &quot;#ffaa00&quot;, &quot;#ff0000&quot;)) + # \u30c8\u30ec\u30f3\u30c7\u30a3\u306a\u30ab\u30e9\u30fc\u8a2d\u5b9a\n  labs(title = &quot;\u30a2\u30a6\u30c8\u30ab\u30a6\u30f3\u30c8\u306e\u53ef\u8996\u5316&quot;, x = NULL, y = NULL) + # \u8ef8\u30e9\u30d9\u30eb\u306e\u524a\u9664\n  theme_minimal() + # \u30e2\u30c0\u30f3\u3067\u304d\u308c\u3044\u306a\u30c6\u30fc\u30de\u3092\u4f7f\u3046\n  theme(\n    plot.title = element_text(size = 20, face = &quot;bold&quot;, hjust = 0.5)\u3001#\u30bf\u30a4\u30c8\u30eb\u306e\u4e2d\u592e\u63c3\u3048\u3068\u30b5\u30a4\u30ba\u8a2d\u5b9a\n    axis.text.x = element_text(size = 15, face = &quot;bold&quot;, color = &quot;#55555555&quot;) # X\u8ef8\u30e9\u30d9\u30eb\u306e\u30b5\u30a4\u30ba\u3068\u8272\u306e\u8a2d\u5b9a\n  )<\/code><\/pre>\n\n\n\n<p><strong>\u8aac\u660e\uff1a<\/strong><br>\u4e0a\u306e\u30b3\u30fc\u30c9\u306f\u3001\u30a2\u30a6\u30c8\u30ab\u30a6\u30f3\u30c8\u3092\u8996\u899a\u7684\u306b\u8868\u73fe\u3057\u305f\u30c8\u30ec\u30f3\u30c7\u30a3\u306a\u68d2\u30b0\u30e9\u30d5\u3067\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u8272\u3067\u3059\uff1a<\/strong> \u30e2\u30c0\u30f3\u3067\u8996\u899a\u7684\u306b\u5f37\u70c8\u306a\u8272\uff08\u9752\u3001\u9ec4\u3001\u8d64\uff09\u3092\u4f7f\u7528\u3057\u307e\u3057\u305f\u3002<\/li>\n\n\n\n<li><strong>\u30c6\u30ad\u30b9\u30c8\u306e\u5f37\u8abf\u8868\u793a\uff1a<\/strong> \u5404\u30d0\u30fc\u306e\u4e0a\u306b\u5bfe\u5fdc\u3059\u308b\u30a2\u30a6\u30c8\u30ab\u30a6\u30f3\u30c8\u3092\u30c6\u30ad\u30b9\u30c8\u3067\u8868\u793a\u3057\u3001\u76f4\u611f\u6027\u3092\u9ad8\u3081\u307e\u3057\u305f\u3002<\/li>\n\n\n\n<li><strong>\u30b0\u30e9\u30d5\u306e\u30ec\u30a4\u30a2\u30a6\u30c8\uff1a<\/strong> \u3059\u3063\u304d\u308a\u3068\u3057\u305f\u30df\u30cb\u30de\u30eb\u306a\u30c7\u30b6\u30a4\u30f3\u306e\u305f\u3081\u306b\u3001\u4e0d\u8981\u306a\u8ef8\u3068\u30e9\u30d9\u30eb\u3092\u524a\u9664\u3057\u3001\u30c6\u30ad\u30b9\u30c8\u306e\u30b5\u30a4\u30ba\u3068\u30b9\u30bf\u30a4\u30eb\u3092\u8abf\u6574\u3057\u307e\u3057\u305f\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u30b9\u30c8\u30e9\u30a4\u30af\u3068\u30dc\u30fc\u30eb\uff1a\u30c8\u30ec\u30f3\u30c7\u30a3\u306a\u9055\u3044\u3092\u53ef\u8996\u5316\u3059\u308b<\/h3>\n\n\n\n<p>\u91ce\u7403\u3067 <strong>\u30b9\u30c8\u30e9\u30a4\u30af3\u56de\u76ee<\/strong>\u305d\u3057\u3066 <strong>\u30dc\u30fc\u30eb4\u756a<\/strong>\u306e\u9055\u3044\u304c\u76f8\u624b\u306e\u904b\u547d\u3092\u5de6\u53f3\u3057\u307e\u3059\u3002\u3053\u308c\u3092\u73fe\u4ee3\u7684\u306a\u8996\u899a\u5316\u3067\u8868\u73fe\u3057\u3066\u5206\u304b\u308a\u3084\u3059\u304f\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n<style>.kb-image2733_8cd63e-9b .kb-image-has-overlay:after{opacity:0.3;border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;}.kb-image2733_8cd63e-9b img.kb-img, .kb-image2733_8cd63e-9b .kb-img img{border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}<\/style>\n<div class=\"wp-block-kadence-image kb-image2733_8cd63e-9b\"><figure class=\"aligncenter size-medium_large\"><img decoding=\"async\" width=\"768\" height=\"461\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/10\/image-768x461.jpg\" alt=\"\uc57c\uad6c \uaddc\uce59 - \uc2a4\ud2b8\ub77c\uc774\ud06c\uc640 \ubcfc\" class=\"kb-img wp-image-2736\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/10\/image-768x461.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/10\/image-300x180.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/10\/image-600x360.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/10\/image.jpg 1200w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/figure><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code># R\u30b3\u30fc\u30c9\uff1a\u30b9\u30c8\u30e9\u30a4\u30af\u3068\u30dc\u30fc\u30eb\u306e\u53ef\u8996\u5316\nstrikes_balls &lt;- data.frame(\n  category = c(&quot;\u30b9\u30c8\u30e9\u30a4\u30af&quot;, &quot;\u30dc\u30fc\u30eb&quot;)\u3001\n  count = c(3, 4)\n)\n\nggplot(strikes_balls, aes(x = category, y = count, fill = category)) +\n  geom_col(width = 0.5, show.legend = FALSE) + # \u73fe\u4ee3\u7684\u306a\u68d2\u30b0\u30e9\u30d5\u3092\u751f\u6210\u3059\u308b\n  geom_text(aes(label = count), vjust = -0.5, size = 6, fontface = &quot;bold&quot;, color = &quot;white&quot;) + # \u30c6\u30ad\u30b9\u30c8\u306e\u5f37\u8abf\u8868\u793a\n  scale_fill_manual(values = c(&quot;#00cc66&quot;, &quot;#ff6666&quot;)) + # \u30c8\u30ec\u30f3\u30c9\u30ab\u30e9\u30fc\u8a2d\u5b9a\n  labs(title = &quot;\u30b9\u30c8\u30e9\u30a4\u30afvs\u30dc\u30fc\u30eb&quot;, x = NULL, y = NULL) + # \u8ef8\u306e\u30e9\u30d9\u30eb\u3092\u53d6\u308a\u9664\u304f\n  theme_minimal() + # \u7dba\u9e97\u306a\u30c6\u30fc\u30de\u3092\u4f7f\u3046\n  theme(\n    plot.title = element_text(size = 20, face = &quot;bold&quot;, hjust = 0.5)\u3001# \u30bf\u30a4\u30c8\u30eb\u4e2d\u592e\u63c3\u3048\n    axis.text.x = element_text(size = 15, face = &quot;bold&quot;, color = &quot;#33333333&quot;) # X\u8ef8\u306e\u30c6\u30ad\u30b9\u30c8\u30b9\u30bf\u30a4\u30eb\u8a2d\u5b9a\n  )<\/code><\/pre>\n\n\n\n<p><strong>\u8aac\u660e\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u30b9\u30c8\u30e9\u30a4\u30af\u3068\u30dc\u30fc\u30eb\u306e\u9055\u3044\uff1a<\/strong> 3\u3064\u306e\u30b9\u30c8\u30e9\u30a4\u30af\u30684\u3064\u306e\u30dc\u30fc\u30eb\u3092\u6bd4\u8f03\u3059\u308b\u305f\u3081\u306b\u68d2\u30b0\u30e9\u30d5\u3067\u8996\u899a\u5316\u3057\u307e\u3057\u305f\u3002<\/li>\n\n\n\n<li><strong>\u8272\u306e\u5dee\u5225\u5316\uff1a<\/strong> \u30b9\u30c8\u30e9\u30a4\u30af\u306f\u7dd1(#00cc66)\u3001\u30dc\u30fc\u30eb\u306f\u8d64(#ff6666)\u3067\u533a\u5225\u3057\u3066\u660e\u78ba\u306b\u8868\u73fe\u3057\u307e\u3057\u305f\u3002<\/li>\n\n\n\n<li><strong>\u30c6\u30ad\u30b9\u30c8\u306e\u5f37\u8abf\u8868\u793a\uff1a<\/strong> \u305d\u308c\u305e\u308c\u306e\u30d0\u30fc\u306e\u4e0a\u306b\u5bfe\u5fdc\u3059\u308b\u6570\u5024\u3092\u8ffd\u52a0\u3057\u3066\u3001\u3088\u308a\u7c21\u5358\u306b\u30eb\u30fc\u30eb\u3092\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u30d9\u30fc\u30b9\u9593\u306e\u8ddd\u96e2\u3068\u8d70\u5841\u30d7\u30ec\u30fc\u306e\u53ef\u8996\u5316 (\u30e1\u30fc\u30c8\u30eb\u5358\u4f4d)<\/h3>\n\n\n\n<p><a href=\"https:\/\/www.koreabaseball.com\/\" target=\"_blank\" rel=\"noopener\">KBO<\/a>\u304b\u3089\u30d9\u30fc\u30b9\u9593\u306e\u8ddd\u96e2\u306f <strong>\u7d0427.43\u30e1\u30fc\u30c8\u30eb(90\u30d5\u30a3\u30fc\u30c8)<\/strong>\u3067\u3059\u3002\u30e9\u30f3\u30ca\u30fc\u304c\u5404\u30d9\u30fc\u30b9\u9593\u3092\u8d70\u308b\u7d4c\u8def\u3068\u8ddd\u96e2\u3092\u8996\u899a\u7684\u306b\u8868\u73fe\u3059\u308b\u3053\u3068\u3067\u3001\u8d70\u5841\u30d7\u30ec\u30fc\u306e\u91cd\u8981\u6027\u3092\u5bb9\u6613\u306b\u628a\u63e1\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n<style>.kb-image2733_21c31f-13 .kb-image-has-overlay:after{opacity:0.3;border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;}.kb-image2733_21c31f-13 img.kb-img, .kb-image2733_21c31f-13 .kb-img img{border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}<\/style>\n<div class=\"wp-block-kadence-image kb-image2733_21c31f-13\"><figure class=\"aligncenter size-medium_large\"><img decoding=\"async\" width=\"768\" height=\"384\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/10\/image-1-768x384.jpg\" alt=\"\uc57c\uad6c \uaddc\uce59 - \ubca0\uc774\uc2a4 \uc0ac\uc774\uc758 \uac70\ub9ac\" class=\"kb-img wp-image-2738\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/10\/image-1-768x384.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/10\/image-1-300x150.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/10\/image-1-600x300.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/10\/image-1.jpg 1200w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/figure><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code># R\u30b3\u30fc\u30c9: \u30d9\u30fc\u30b9\u9593\u306e\u8ddd\u96e2\u306e\u53ef\u8996\u5316 (\u30e1\u30fc\u30c8\u30eb\u5358\u4f4d)\nbase_distance &lt;- data.frame(\n  base = c(&quot;\u30db\u30fc\u30e0\u21921\u5841&quot;, &quot;1\u5841\u21922\u5841&quot;, &quot;2\u5841\u21923\u5841&quot;, &quot;3\u5841\u2192\u30db\u30fc\u30e0&quot;)\u3001\n  distance = c(27.43, 27.43, 27.43, 27.43, 27.43) # KBO\u57fa\u6e96\u30e1\u30fc\u30c8\u30eb\u5358\u4f4d\n)\n\nggplot(base_distance, aes(x = base, y = distance, fill = base)) +\n  geom_col(width = 0.7, show.legend = FALSE) + # \u30e2\u30c0\u30f3\u306a\u611f\u3058\u306e\u68d2\u30b0\u30e9\u30d5\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002\n  geom_text(aes(label = sprintf(&quot;%.2f \u30e1\u30fc\u30c8\u30eb&quot;, distance)), vjust = -0.5, size = 5, color = &quot;black&quot;, fontface = &quot;bold&quot;) + # \u8ddd\u96e2\u5024\u8868\u793a\n  scale_fill_manual(values = c(&quot;#ffcc33&quot;, &quot;#3399ff&quot;, &quot;#33cc33&quot;, &quot;#ff6666&quot;)) + #\u30d9\u30fc\u30b9\u9593\u306e\u7570\u306a\u308b\u8272\u8a2d\u5b9a\n  labs(title = &quot;\u30d9\u30fc\u30b9\u9593\u306e\u8ddd\u96e2\u306e\u53ef\u8996\u5316(\u30e1\u30fc\u30c8\u30eb)&quot;, x = NULL, y = NULL) + # \u8ef8\u306e\u30e9\u30d9\u30eb\u3092\u53d6\u308a\u9664\u304f\n  theme_minimal() + # \u73fe\u4ee3\u7684\u306a\u30c6\u30fc\u30de\u306e\u4f7f\u7528\n  theme(\n    plot.title = element_text(size = 20, face = &quot;bold&quot;, hjust = 0.5)\u3001# \u30bf\u30a4\u30c8\u30eb\u4e2d\u592e\u63c3\u3048\u3068\u30b9\u30bf\u30a4\u30eb\u8a2d\u5b9a\n    axis.text.x = element_text(size = 14, face = &quot;bold&quot;, color = &quot;#66666666&quot;) # X\u8ef8\u30c6\u30ad\u30b9\u30c8\u30b9\u30bf\u30a4\u30eb\u8a2d\u5b9a\n  )<\/code><\/pre>\n\n\n\n<p><strong>\u8aac\u660e\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u30d9\u30fc\u30b9\u9593\u306e\u8ddd\u96e2\uff1a<\/strong> \u30db\u30fc\u30e0\u30d9\u30fc\u30b9\u304b\u30891\u5841\u30012\u5841\u30013\u5841\u306b\u81f3\u308b\u5404\u533a\u9593\u306f\u5168\u3066\u7d0427.43\u30e1\u30fc\u30c8\u30eb\u3067\u3059\u3002 \u3053\u306e\u8ddd\u96e2\u3092\u8996\u899a\u7684\u306b\u8868\u73fe\u3057\u3001\u8d70\u5841\u30d7\u30ec\u30fc\u306e\u91cd\u8981\u6027\u3092\u5f37\u8abf\u3057\u307e\u3057\u305f\u3002<\/li>\n\n\n\n<li><strong>\u8272\u5206\u3051\uff1a<\/strong> \u5404\u30d9\u30fc\u30b9\u9593\u306e\u533a\u9593\u3092\u69d8\u3005\u306a\u8272\u3067\u533a\u5207\u3063\u3066\u660e\u78ba\u306b\u8868\u73fe\u3057\u307e\u3057\u305f\u3002<\/li>\n\n\n\n<li><strong>\u30c6\u30ad\u30b9\u30c8\u306e\u5f37\u8abf\u8868\u793a\uff1a<\/strong> \u5404\u68d2\u306e\u4e0a\u306b\u5bfe\u5fdc\u3059\u308b\u8ddd\u96e2\u5024\u3092\"\u30e1\u30fc\u30c8\u30eb\"\u3067\u8868\u793a\u3057\u3001\u8ddd\u96e2\u611f\u3092\u611f\u3058\u3084\u3059\u3044\u3088\u3046\u306b\u3057\u307e\u3057\u305f\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u8a66\u5408\u306e\u6d41\u308c\u3092\u5de6\u53f3\u3059\u308b\u5f97\u70b9\u65b9\u6cd5\uff1a\u73fe\u4ee3\u7684\u306a\u8996\u899a\u5316\u3067\u898b\u308b\u30db\u30fc\u30e0\u30e9\u30f3\u3068\u6253\u70b9\u306e\u4ed5\u7d44\u307f<\/h3>\n\n\n\n<p>\u91ce\u7403\u3067\u6700\u3082\u91cd\u8981\u306a\u30eb\u30fc\u30eb\u306e\u3072\u3068\u3064\u306f <strong>\u63a1\u70b9\u65b9\u6cd5<\/strong>\u7279\u306b\u30db\u30fc\u30e0\u30e9\u30f3\u306f\u6253\u8005\u81ea\u8eab\u304c\u5f97\u70b9\u3059\u308b\u6700\u9ad8\u306e\u65b9\u6cd5\u3067\u3059\u3002 \u3053\u308c\u3092\u73fe\u4ee3\u7684\u306a\u8996\u899a\u5316\u3067\u8868\u73fe\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n<style>.kb-image2733_31e252-a7 .kb-image-has-overlay:after{opacity:0.3;border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;}.kb-image2733_31e252-a7 img.kb-img, .kb-image2733_31e252-a7 .kb-img img{border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}<\/style>\n<div class=\"wp-block-kadence-image kb-image2733_31e252-a7\"><figure class=\"aligncenter size-medium_large\"><img decoding=\"async\" width=\"768\" height=\"384\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/10\/image-2-768x384.jpg\" alt=\"\uc57c\uad6c \uaddc\uce59 - \ub4dd\uc810 \ubc29\uc2dd\" class=\"kb-img wp-image-2739\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/10\/image-2-768x384.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/10\/image-2-300x150.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/10\/image-2-600x300.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/10\/image-2.jpg 1200w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/figure><\/div>\n\n\n\n<pre class=\"wp-block-code\"><code># R\u30b3\u30fc\u30c9: \u30db\u30fc\u30e0\u30e9\u30f3\u3068\u6253\u70b9\u306e\u53ef\u8996\u5316\nlibrary(ggplot2)\n\nruns &lt;- data.frame(\n  category = c(&quot;\u30db\u30fc\u30e0\u30e9\u30f3&quot;, &quot;\u6253\u70b9&quot;)\u3001\n  count = c(1, 1)\n)\n\n# ggplot\u3092\u4f7f\u3063\u3066\u672c\u5841\u6253\u3068\u6253\u70b9\u3092\u53ef\u8996\u5316\u3059\u308b\nggplot(runs, aes(x = category, y = count, fill = category)) +\n  geom_col(width = 0.4, show.legend = FALSE) + # \u62ec\u5f27\u3092\u8ffd\u52a0\u3057\u3066\u68d2\u30b0\u30e9\u30d5\u3092\u751f\u6210\u3057\u307e\u3059\u3002\n  geom_text(aes(label = count), vjust = -0.5, size = 6, fontface = &quot;bold&quot;, color = &quot;white&quot;) + # \u70b9\u6570\u8868\u793a\n  scale_fill_manual(values = c(&quot;#ff9933&quot;, &quot;#9933ff&quot;)) + #\u672c\u5841\u6253\u3068\u6253\u70b9\u306e\u8272\u5206\u3051\n  labs(title = &quot;\u30db\u30fc\u30e0\u30e9\u30f3\u3068\u6253\u70b9\u306e\u53ef\u8996\u5316&quot;, x = NULL, y = NULL) + # \u8ef8\u306e\u30e9\u30d9\u30eb\u3092\u53d6\u308a\u9664\u304f\n  theme_minimal() + # \u304d\u308c\u3044\u306a\u30c6\u30fc\u30de\u306e\u4f7f\u7528\n  theme(\n    plot.title = element_text(size = 20, face = &quot;bold&quot;, hjust = 0.5)\u3001#\u30bf\u30a4\u30c8\u30eb\u3092\u4e2d\u592e\u306b\u63c3\u3048\u308b\n    axis.text.x = element_text(size = 15, face = &quot;bold&quot;, color = &quot;#44444444&quot;) # X\u8ef8\u306e\u30c6\u30ad\u30b9\u30c8\u30b9\u30bf\u30a4\u30eb\u8a2d\u5b9a\n  )\n<\/code><\/pre>\n\n\n\n<p><strong>\u8aac\u660e\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u30db\u30fc\u30e0\u30e9\u30f3\u3068\u6253\u70b9\u306e\u6bd4\u8f03\uff1a<\/strong> \u30db\u30fc\u30e0\u30e9\u30f3\u306f\u6253\u8005\u304c\u81ea\u5206\u3067\u5f97\u70b9\u3059\u308b\u65b9\u6cd5\u3067\u3042\u308a\u3001\u6253\u70b9\u306f\u4ed6\u306e\u30e9\u30f3\u30ca\u30fc\u3092\u30db\u30fc\u30e0\u306b\u547c\u3073\u8fbc\u3093\u3067\u5f97\u70b9\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002 \u3053\u308c\u3092\u68d2\u30b0\u30e9\u30d5\u3067\u8996\u899a\u5316\u3059\u308b\u3053\u3068\u3067\u3001\u4e8c\u3064\u306e\u5f97\u70b9\u65b9\u6cd5\u3092\u7c21\u5358\u306b\u6bd4\u8f03\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/li>\n\n\n\n<li><strong>\u8272\u306e\u5dee\u5225\u5316\uff1a<\/strong> \u30db\u30fc\u30e0\u30e9\u30f3\u306f\u30aa\u30ec\u30f3\u30b8\u8272(#ff9933)\u3001\u6253\u70b9\u306f\u7d2b\u8272(#9933ff)\u3067\u8868\u73fe\u3057\u3001\u4e21\u8005\u306e\u9055\u3044\u3092\u660e\u78ba\u306b\u793a\u3057\u307e\u3057\u305f\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u7d50\u8ad6: R\u3067\u8996\u899a\u5316\u3057\u305f\u91ce\u7403\u306e\u30eb\u30fc\u30eb\u3092\u3088\u308a\u7c21\u5358\u306b\u7406\u89e3\u3059\u308b\u305f\u3081\u306b<\/h3>\n\n\n\n<p>\u4eca\u56de\u306e\u8a18\u4e8b\u3067\u306f\u3001R\u3092\u4f7f\u3063\u3066\u73fe\u4ee3\u7684\u3067\u30c8\u30ec\u30f3\u30c7\u30a3\u306a\u8996\u899a\u5316\u3067\u91ce\u7403\u306e\u30eb\u30fc\u30eb\u3092\u8aac\u660e\u3057\u307e\u3057\u305f\u3002\u30a2\u30a6\u30c8\u30ab\u30a6\u30f3\u30c8\u3001\u30b9\u30c8\u30e9\u30a4\u30af\u3068\u30dc\u30fc\u30eb\u3001\u30d9\u30fc\u30b9\u9593\u306e\u8ddd\u96e2\u3001\u5f97\u70b9\u65b9\u6cd5\u3092\u305d\u308c\u305e\u308c\u8996\u899a\u5316\u3059\u308b\u3053\u3068\u3067\u3001\u30eb\u30fc\u30eb\u3092\u7c21\u5358\u306b\u7406\u89e3\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002R\u3067\u5b66\u3076\u91ce\u7403\u306e\u30eb\u30fc\u30eb\u3092\u901a\u3057\u3066\u3001\u8907\u96d1\u306a\u30eb\u30fc\u30eb\u3082\u8996\u899a\u7684\u306b\u76f4\u611f\u7684\u306b\u30a2\u30d7\u30ed\u30fc\u30c1\u3067\u304d\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002 \u3053\u308c\u304b\u3089\u3082 <a href=\"https:\/\/secondlife.lol\/ja\/baseball-field-positions-r-visualization\/\" data-type=\"link\" data-id=\"https:\/\/secondlife.lol\/baseball-field-positions-r-visualization\/\">R\u3092\u6d3b\u7528\u3057\u305f\u69d8\u3005\u306a\u30eb\u30fc\u30eb\u306e\u53ef\u8996\u5316<\/a>\u3067\u91ce\u7403\u306e\u697d\u3057\u3055\u3092\u3082\u3063\u3068\u611f\u3058\u3066\u304f\u3060\u3055\u3044\uff01<\/p>","protected":false},"excerpt":{"rendered":"<p>\u91ce\u7403\u306e\u30eb\u30fc\u30eb\u306f\u8907\u96d1\u3067\u96e3\u3057\u3044\u3068\u601d\u3044\u307e\u3059\u304b\uff1f \u3067\u306f\u3001\u4eca\u56de\u306fR\u3092\u4f7f\u3063\u3066\u30c7\u30fc\u30bf\u3092...<\/p>","protected":false},"author":3,"featured_media":2742,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6],"tags":[305,300,308,164,307,309,306],"class_list":["post-2733","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r-coding","tag-kbo","tag-r-","tag-r--","tag-164","tag-307","tag-309","tag-306"],"taxonomy_info":{"category":[{"value":6,"label":"\uc54c(R)"}],"post_tag":[{"value":305,"label":"KBO"},{"value":300,"label":"R \uc2dc\uac01\ud654"},{"value":308,"label":"R\ub85c \uc57c\uad6c \ubc30\uc6b0\uae30"},{"value":164,"label":"\ub370\uc774\ud130 \uc2dc\uac01\ud654"},{"value":307,"label":"\uc57c\uad6c \uaddc\uce59"},{"value":309,"label":"\uc57c\uad6c \uaddc\uce59 \uc124\uba85"},{"value":306,"label":"\uc57c\uad6c \ub370\uc774\ud130 \ubd84\uc11d"}]},"featured_image_src_large":["https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/10\/\uc57c\uad6c-\uaddc\uce59-\ud3ec\uc2a4\ud2b8-\uc378\ub124\uc77c-600x600.webp",600,600,true],"author_info":{"display_name":"TERE","author_link":"https:\/\/secondlife.lol\/ja\/author\/tere\/"},"comment_info":0,"category_info":[{"term_id":6,"name":"\uc54c(R)","slug":"r-coding","term_group":0,"term_taxonomy_id":6,"taxonomy":"category","description":"","parent":20,"count":61,"filter":"raw","cat_ID":6,"category_count":61,"category_description":"","cat_name":"\uc54c(R)","category_nicename":"r-coding","category_parent":20}],"tag_info":[{"term_id":305,"name":"KBO","slug":"kbo","term_group":0,"term_taxonomy_id":305,"taxonomy":"post_tag","description":"","parent":0,"count":2,"filter":"raw"},{"term_id":300,"name":"R \uc2dc\uac01\ud654","slug":"r-%ec%8b%9c%ea%b0%81%ed%99%94","term_group":0,"term_taxonomy_id":300,"taxonomy":"post_tag","description":"","parent":0,"count":12,"filter":"raw"},{"term_id":308,"name":"R\ub85c \uc57c\uad6c \ubc30\uc6b0\uae30","slug":"r%eb%a1%9c-%ec%95%bc%ea%b5%ac-%eb%b0%b0%ec%9a%b0%ea%b8%b0","term_group":0,"term_taxonomy_id":308,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":164,"name":"\ub370\uc774\ud130 \uc2dc\uac01\ud654","slug":"%eb%8d%b0%ec%9d%b4%ed%84%b0-%ec%8b%9c%ea%b0%81%ed%99%94","term_group":0,"term_taxonomy_id":164,"taxonomy":"post_tag","description":"","parent":0,"count":52,"filter":"raw"},{"term_id":307,"name":"\uc57c\uad6c \uaddc\uce59","slug":"%ec%95%bc%ea%b5%ac-%ea%b7%9c%ec%b9%99","term_group":0,"term_taxonomy_id":307,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":309,"name":"\uc57c\uad6c \uaddc\uce59 \uc124\uba85","slug":"%ec%95%bc%ea%b5%ac-%ea%b7%9c%ec%b9%99-%ec%84%a4%eb%aa%85","term_group":0,"term_taxonomy_id":309,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":306,"name":"\uc57c\uad6c \ub370\uc774\ud130 \ubd84\uc11d","slug":"%ec%95%bc%ea%b5%ac-%eb%8d%b0%ec%9d%b4%ed%84%b0-%eb%b6%84%ec%84%9d","term_group":0,"term_taxonomy_id":306,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"}],"_links":{"self":[{"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/posts\/2733","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/comments?post=2733"}],"version-history":[{"count":8,"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/posts\/2733\/revisions"}],"predecessor-version":[{"id":2750,"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/posts\/2733\/revisions\/2750"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/media\/2742"}],"wp:attachment":[{"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/media?parent=2733"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/categories?post=2733"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/tags?post=2733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}