{"id":1676,"date":"2025-05-25T20:00:31","date_gmt":"2025-05-25T11:00:31","guid":{"rendered":"https:\/\/info.zanet.biz\/?p=1676"},"modified":"2025-05-25T20:00:32","modified_gmt":"2025-05-25T11:00:32","slug":"copilot%e3%81%a7r%e3%81%ae%e3%82%b9%e3%82%af%e3%83%aa%e3%83%97%e3%83%88%e3%82%92%e4%bd%9c%e6%88%90%e3%81%99%e3%82%8b%ef%bc%9a%e7%9b%b8%e9%96%a2%e3%80%81%e6%95%a3%e5%b8%83%e5%9b%b3%e3%80%81%e7%9b%b4","status":"publish","type":"post","link":"https:\/\/info.zanet.biz\/?p=1676","title":{"rendered":"Copilot\u3067R\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3059\u308b\uff1a\u76f8\u95a2\u3001\u6563\u5e03\u56f3\u3001\u76f4\u7dda\u56de\u5e30\u3001\u91cd\u56de\u5e30"},"content":{"rendered":"\n<p>\u4eca\u56de\u306f\u3001Copilot\u306bR\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u63d0\u6848\u3057\u3066\u3082\u3089\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<p>\u9752\u306e\u30dc\u30c3\u30af\u30b9\u5185\u306b\u66f8\u3044\u3066\u3042\u308b\u306e\u304c\u30d7\u30ed\u30f3\u30d7\u30c8\u3067\u3059\u3002\u53f3\u7aef\u306e\u30a2\u30a4\u30b3\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068Copilot\u306e\u56de\u7b54\u3092\u8868\u793a\u3057\u305f\u308a\u96a0\u3057\u305f\u308a\u3067\u304d\u307e\u3059\u3002\u305d\u306e\u4e0b\u306b\u306fR\u3067\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5b9f\u884c\u7d50\u679c\u3092\u793a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u307e\u305a\u3001R\u306e\u6a19\u6e96\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3067\u76f8\u95a2\u306b\u95a2\u3059\u308b\u30c7\u30fc\u30bf\u30b5\u30f3\u30d7\u30eb\u304c\u3042\u308b\u304b\u805e\u3044\u3066\u307f\u307e\u3059\u3002<\/p>\n\n\n\n<details class=\"wp-block-liquid-accordion\" style=\"border-color:#00aeef\"><summary class=\"liquid-accordion-top\" style=\"color:#333333;background-color:#00aeef\">R\u306e\u6a19\u6e96\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u76f8\u95a2\u306b\u95a2\u3059\u308b\u30b5\u30f3\u30d7\u30eb\u30c7\u30fc\u30bf\u306f\u3042\u308a\u307e\u3059\u304b\uff1f<\/summary><div class=\"liquid-accordion-bottom\">\n<p>\u306f\u3044\u3001R\u306b\u306f\u76f8\u95a2\u3092\u8abf\u67fb\u3059\u308b\u306e\u306b\u9069\u3057\u305f\u6a19\u6e96\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u304c\u3044\u304f\u3064\u304b\u542b\u307e\u308c\u3066\u3044\u307e\u3059\u3002\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>mtcars<\/code>\uff1a32\u7a2e\u985e\u306e\u8eca\u306b\u95a2\u3059\u308b\u71c3\u8cbb\u3084\u99ac\u529b\u3001\u91cd\u91cf\u306a\u3069\u306e\u30c7\u30fc\u30bf\u304c\u542b\u307e\u308c\u3066\u304a\u308a\u3001\u3053\u308c\u3089\u306e\u5909\u6570\u9593\u306e\u76f8\u95a2\u3092\u5206\u6790\u3059\u308b\u306e\u306b\u4fbf\u5229\u3067\u3059\u3002<\/li>\n\n\n\n<li><code>iris<\/code>\uff1a\u30a2\u30e4\u30e1\u306e\u7a2e\u985e\u3054\u3068\u306e\u82b1\u5f01\u306e\u9577\u3055\u3084\u5e45\u306a\u3069\u306e\u30c7\u30fc\u30bf\u304c\u3042\u308a\u3001\u6570\u5024\u5909\u6570\u9593\u306e\u95a2\u4fc2\u6027\u3092\u8abf\u3079\u308b\u306e\u306b\u9069\u3057\u3066\u3044\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>airquality<\/code>\uff1a\u5927\u6c17\u6c5a\u67d3\u306b\u95a2\u3059\u308b\u30c7\u30fc\u30bf\u3067\u3001\u6e29\u5ea6\u3084\u98a8\u901f\u3068\u30aa\u30be\u30f3\u6fc3\u5ea6\u306e\u76f8\u95a2\u3092\u691c\u8a0e\u3067\u304d\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>mtcars<\/code>\uff1a\u81ea\u52d5\u8eca\u306e\u4ed5\u69d8\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3067\u3001\u71c3\u8cbb\u3068\u8eca\u4e21\u91cd\u91cf\u306e\u95a2\u4fc2\u306a\u3069\u3092\u5206\u6790\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u4f8b\u3048\u3070\u3001<code>mtcars<\/code>\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u5909\u6570\u9593\u306e\u76f8\u95a2\u4fc2\u6570\u3092\u6c42\u3081\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>data(mtcars)  # \u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u30ed\u30fc\u30c9\ncor(mtcars)   # \u76f8\u95a2\u4fc2\u6570\u3092\u8a08\u7b97<\/code><\/pre>\n\n\n\n<p>\u7279\u5b9a\u306e\u5909\u6570\u9593\u306e\u76f8\u95a2\u3092\u8abf\u3079\u305f\u3044\u5834\u5408\u306f\u3001\u4f8b\u3048\u3070<code>mpg<\/code>\u3068<code>hp<\/code>\u306e\u95a2\u4fc2\u3092\u78ba\u8a8d\u3059\u308b\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cor(mtcars$mpg, mtcars$hp)<\/code><\/pre>\n\n\n\n<p>\u4ed6\u306b\u3082\u3001<code>cor.test()<\/code>\u95a2\u6570\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001\u76f8\u95a2\u306e\u7d71\u8a08\u7684\u6709\u610f\u6027\u3092\u691c\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u8208\u5473\u306e\u3042\u308b\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u304c\u3042\u308c\u3070\u3001\u8a73\u3057\u304f\u8aac\u660e\u3067\u304d\u307e\u3059\u306e\u3067\u3001\u304a\u77e5\u3089\u305b\u304f\u3060\u3055\u3044\uff01<\/p>\n<\/div><\/details>\n\n\n\n<p>\u7279\u306b\u6307\u793a\u306f\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e\u89e3\u8aac\u3068\u3001\u76f8\u95a2\u4fc2\u6570\u306e\u8a08\u7b97\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u63d0\u793a\u3055\u308c\u307e\u3057\u305f\u3002\u305d\u308c\u3092R\u306e\u30a8\u30c7\u30a3\u30bf\u306b\u30b3\u30d4\u30fc\u30fb\u8cbc\u308a\u4ed8\u3051\u3066\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u7d50\u679c\u304c\u3001\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u51fa\u529b\u3055\u308c\u307e\u3057\u305f\u300232\u7a2e\u985e\u306e\u8eca\u306e\u71c3\u8cbb\u3001\u99ac\u529b\u306a\u3069\u306e\u5024\u306b\u3064\u3044\u3066\u3001cor()\u95a2\u6570\u3067\u306e\u6f14\u7b97\u7d50\u679c\u304c\u3001\u76f8\u95a2\u884c\u5217\u3068\u3057\u3066\u5f97\u3089\u308c\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"886\" height=\"625\" src=\"https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-3.png\" alt=\"\" class=\"wp-image-1677\" srcset=\"https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-3.png 886w, https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-3-300x212.png 300w, https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-3-768x542.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p>\u6b21\u306b\u3001\u6563\u5e03\u56f3\u3092\u63cf\u753b\u3057\u3066\u307f\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002\u99ac\u529bhp\u3068\u71c3\u8cbbmpg\u306e\u95a2\u4fc2\u3092\u898b\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u30b0\u30e9\u30d5\u4f5c\u6210\u306b\u306fggplot2\u3068\u3044\u3046\u30d1\u30c3\u30b1\u30fc\u30b8\u304c\u826f\u304f\u4f7f\u308f\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u308c\u3092\u4f7f\u3046\u3088\u3046\u6307\u793a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<details class=\"wp-block-liquid-accordion\" style=\"border-color:#00aeef\"><summary class=\"liquid-accordion-top\" style=\"color:#333333;background-color:#00aeef\">mtcars\u306ehp\u3092X\u8ef8\u306b\u3001mpg\u3092Y\u8ef8\u306b\u6563\u5e03\u56f3\u3092ggplot2\u3067\u63cf\u304f\u30b9\u30af\u30ea\u30d7\u30c8\u306f\uff1f<\/summary><div class=\"liquid-accordion-bottom\">\n<p><code>ggplot2<\/code>\u3092\u4f7f\u3063\u3066<code>mtcars<\/code>\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306e<code>hp<\/code>\u3092X\u8ef8\u3001<code>mpg<\/code>\u3092Y\u8ef8\u306b\u3057\u305f\u6563\u5e03\u56f3\u3092\u63cf\u304f\u306b\u306f\u3001\u4ee5\u4e0b\u306eR\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># ggplot2\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u8aad\u307f\u8fbc\u3080\nlibrary(ggplot2)\n\n# mtcars\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u4f7f\u7528\u3057\u3066\u6563\u5e03\u56f3\u3092\u63cf\u753b\nggplot(mtcars, aes(x = hp, y = mpg)) +\n  geom_point() +                      # \u6563\u5e03\u56f3\u306e\u30dd\u30a4\u30f3\u30c8\u3092\u8ffd\u52a0\n  labs(title = \"Horsepower vs. Miles Per Gallon\", \n       x = \"Horsepower (hp)\", \n       y = \"Miles Per Gallon (mpg)\") +\n  theme_minimal()                      # \u30b7\u30f3\u30d7\u30eb\u306a\u30c6\u30fc\u30de\u3092\u9069\u7528<\/code><\/pre>\n\n\n\n<p>\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u306f\u3001<code>ggplot()<\/code>\u3092\u4f7f\u3063\u3066\u30c7\u30fc\u30bf\u3092\u6307\u5b9a\u3057\u3001<code>geom_point()<\/code>\u3067\u6563\u5e03\u56f3\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059\u3002\u307e\u305f\u3001<code>labs()<\/code>\u3092\u4f7f\u3063\u3066\u30bf\u30a4\u30c8\u30eb\u3084\u8ef8\u30e9\u30d9\u30eb\u3092\u8a2d\u5b9a\u3057\u3001<code>theme_minimal()<\/code>\u3067\u30b7\u30f3\u30d7\u30eb\u306a\u30c7\u30b6\u30a4\u30f3\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3082\u3057\u56de\u5e30\u7dda\u3092\u8ffd\u52a0\u3057\u305f\u3044\u5834\u5408\u306f\u3001<code>geom_smooth()<\/code>\u3092\u4f7f\u3046\u3068\u4fbf\u5229\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ggplot(mtcars, aes(x = hp, y = mpg)) +\n  geom_point() +\n  geom_smooth(method = \"lm\", se = FALSE, color = \"blue\") +\n  labs(title = \"Horsepower vs. Miles Per Gallon with Regression Line\",\n       x = \"Horsepower (hp)\",\n       y = \"Miles Per Gallon (mpg)\") +\n  theme_minimal()<\/code><\/pre>\n\n\n\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001<code>geom_smooth(method = \"lm\")<\/code>\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3067\u3001\u7dda\u5f62\u56de\u5e30\u3092\u30d7\u30ed\u30c3\u30c8\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u306e\u65b9\u6cd5\u3084\u4ed6\u306e\u63cf\u753b\u30b9\u30bf\u30a4\u30eb\u306b\u3064\u3044\u3066\u3082\u3001\u304a\u624b\u4f1d\u3044\u3067\u304d\u307e\u3059\u306e\u3067\u3001\u6c17\u8efd\u306b\u805e\u3044\u3066\u304f\u3060\u3055\u3044\u306d\uff01<\/p>\n<\/div><\/details>\n\n\n\n<p>\u6563\u5e03\u56f3\u63cf\u753b\u306e\u305f\u3081\u306e\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u63d0\u793a\u3055\u308c\u307e\u3057\u305f\u3002\u307e\u305a\u3001\u305d\u308c\u3092R\u306e\u30a8\u30c7\u30a3\u30bf\u306b\u30b3\u30d4\u30fc\u30fb\u8cbc\u308a\u4ed8\u3051\u3066\u5b9f\u884c\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u30b0\u30e9\u30d5\u304c\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"672\" height=\"671\" src=\"https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-4.png\" alt=\"\" class=\"wp-image-1678\" srcset=\"https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-4.png 672w, https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-4-300x300.png 300w, https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-4-150x150.png 150w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/figure>\n\n\n\n<p>\u3053\u308c\u3082\u7279\u306b\u30d7\u30ed\u30f3\u30d7\u30c8\u3067\u306f\u6307\u793a\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u56de\u5e30\u76f4\u7dda\u3092\u63cf\u753b\u306b\u8ffd\u52a0\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u304c\u63d0\u793a\u3055\u308c\u305f\u306e\u3067\u3001\u305d\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u30b0\u30e9\u30d5\u304c\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u306e\u5834\u5408\u3001\u524d\u306e\u30b0\u30e9\u30d5\u306b\u4e0a\u66f8\u304d\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"672\" height=\"671\" src=\"https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-5.png\" alt=\"\" class=\"wp-image-1679\" srcset=\"https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-5.png 672w, https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-5-300x300.png 300w, https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-5-150x150.png 150w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/figure>\n\n\n\n<p>\u305d\u308c\u3067\u306f\u3001hp\u3068mpg\u306e\u6563\u5e03\u56f3\u3068hp\u3068cyl\u306e\u6563\u5e03\u56f3\u3092\u91cd\u306d\u3066\u63cf\u753b\u3059\u308b\u306b\u306f\u3069\u3046\u3059\u308b\u304bCopilot\u306b\u805e\u3044\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<details class=\"wp-block-liquid-accordion\" style=\"border-color:#00aeef\"><summary class=\"liquid-accordion-top\" style=\"color:#333333;background-color:#00aeef\">hp\u3068mpg\u306e\u6563\u5e03\u56f3\u306e\u56de\u5e30\u76f4\u7dda\u306e\u30b0\u30e9\u30d5\u306b\u91cd\u306d\u3066hp\u3068cyl\u306e\u6563\u5e03\u56f3\u3068<br>\u56de\u5e30\u76f4\u7dda\u3092\u63cf\u753b\u3059\u308b\u306b\u306f\uff1fmpg\u3068cyl\u3067\u306f\u30dd\u30a4\u30f3\u30c8\u3068\u76f4\u7dda\u306e\u8272\u3092\u5909\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/summary><div class=\"liquid-accordion-bottom\">\n<p><code>ggplot2<\/code>\u3092\u4f7f\u3063\u3066<code>hp<\/code>\u3068<code>mpg<\/code>\u3001<code>hp<\/code>\u3068<code>cyl<\/code>\u306e\u6563\u5e03\u56f3\u3068\u56de\u5e30\u76f4\u7dda\u3092\u91cd\u306d\u3066\u63cf\u753b\u3059\u308b\u306b\u306f\u3001<code>aes()<\/code>\u306e<code>color<\/code>\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u5229\u7528\u3057\u3066\u30dd\u30a4\u30f3\u30c8\u3068\u56de\u5e30\u7dda\u306e\u8272\u3092\u5909\u66f4\u3059\u308b\u3068\u4fbf\u5229\u3067\u3059\u3002\u4ee5\u4e0b\u306eR\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u5b9f\u73fe\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u8aad\u307f\u8fbc\u3080\nlibrary(ggplot2)\n\n# \u30b0\u30e9\u30d5\u306e\u4f5c\u6210\nggplot(mtcars, aes(x = hp)) +\n  # mpg\u306e\u6563\u5e03\u56f3\u3068\u56de\u5e30\u76f4\u7dda\uff08\u9752\u8272\uff09\n  geom_point(aes(y = mpg, color = \"mpg\"), alpha = 0.7) +\n  geom_smooth(aes(y = mpg, color = \"mpg\"), method = \"lm\", se = FALSE) +\n  # cyl\u306e\u6563\u5e03\u56f3\u3068\u56de\u5e30\u76f4\u7dda\uff08\u8d64\u8272\uff09\n  geom_point(aes(y = cyl, color = \"cyl\"), alpha = 0.7) +\n  geom_smooth(aes(y = cyl, color = \"cyl\"), method = \"lm\", se = FALSE) +\n  # \u30ab\u30b9\u30bf\u30e0\u306e\u51e1\u4f8b\u30bf\u30a4\u30c8\u30eb\n  scale_color_manual(values = c(\"mpg\" = \"blue\", \"cyl\" = \"red\")) +\n  labs(title = \"Horsepower vs. MPG and Cylinders\",\n       x = \"Horsepower (hp)\",\n       y = \"Values\",\n       color = \"Variable\") +\n  theme_minimal()<\/code><\/pre>\n\n\n\n<p>\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3067\u306f\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>aes(y = mpg, color = \"mpg\")<\/code> \u3068 <code>aes(y = cyl, color = \"cyl\")<\/code> \u3092\u4f7f\u3044\u3001<code>mpg<\/code>\u3092\u9752\u3001<code>cyl<\/code>\u3092\u8d64\u3067\u63cf\u753b\u3057\u3066\u3044\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>geom_smooth()<\/code> \u3067\u305d\u308c\u305e\u308c\u56de\u5e30\u76f4\u7dda\u3092\u8ffd\u52a0\u3002<\/li>\n\n\n\n<li><code>scale_color_manual(values = c(\"mpg\" = \"blue\", \"cyl\" = \"red\"))<\/code> \u306b\u3088\u308a\u3001\u51e1\u4f8b\u306e\u8272\u3092\u6307\u5b9a\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u3053\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001<code>hp<\/code>\u3092X\u8ef8\u306b\u3001<code>mpg<\/code>\u3068<code>cyl<\/code>\u3092Y\u8ef8\u306b\u3057\u305f\u6563\u5e03\u56f3\u304c\u8868\u793a\u3055\u308c\u3001\u8272\u5206\u3051\u3055\u308c\u305f\u56de\u5e30\u76f4\u7dda\u304c\u91cd\u306d\u3089\u308c\u307e\u3059\uff01<\/p>\n\n\n\n<p>\u4ed6\u306b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3057\u305f\u3044\u70b9\u304c\u3042\u308c\u3070\u3001\u9060\u616e\u306a\u304f\u805e\u3044\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<\/div><\/details>\n\n\n\n<p>Copilot\u304c\u63d0\u793a\u3057\u305f\u30b9\u30af\u30ea\u30d7\u30c8\u3092R\u306e\u30a8\u30c7\u30a3\u30bf\u306b\u30b3\u30d4\u30fc\u30fb\u8cbc\u308a\u4ed8\u3051\u3057\u3066\u305d\u306e\u307e\u307e\u5b9f\u884c\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u30b0\u30e9\u30d5\u304c\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"672\" height=\"671\" src=\"https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-6.png\" alt=\"\" class=\"wp-image-1680\" srcset=\"https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-6.png 672w, https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-6-300x300.png 300w, https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-6-150x150.png 150w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/figure>\n\n\n\n<p>\u99ac\u529bhp\u304c\u5927\u304d\u304f\u306a\u308b\u307b\u30691\u30ac\u30ed\u30f3\u5f53\u305f\u308a\u306e\u8d70\u884c\u8ddd\u96e2mpg\u304c\u77ed\u304f\u306a\u308a\uff08\u9752\uff09\u3001\u99ac\u529bhp\u304c\u5927\u304d\u3044\u307b\u3069\u30a8\u30f3\u30b8\u30f3\u306e\u30b7\u30ea\u30f3\u30c0\u30fc\u6570cyl\u304c\u591a\u304f\u306a\u308b\u95a2\u4fc2\u304c\u3042\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u305d\u308c\u3067\u306f\u3001\u76f4\u7dda\u56de\u5e30\u306e\u5207\u7247\u3068\u4fc2\u6570\u3092\u51fa\u529b\u3059\u308b\u306b\u306f\u3069\u306e\u3088\u3046\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3051\u3070\u3044\u3044\u306e\u304b\u805e\u3044\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u307e\u305a\u3001hp\u3068mpg\u306e2\u3064\u306e\u5909\u6570\u306b\u3064\u3044\u3066\u3067\u3059\u3002<\/p>\n\n\n\n<details class=\"wp-block-liquid-accordion\" style=\"border-color:#00aeef\"><summary class=\"liquid-accordion-top\" style=\"color:#333333;background-color:#00aeef\">hp\u3068mpg\u306e\u9593\u306e\u76f4\u7dda\u56de\u5e30\u306e\u5207\u7247\u306e\u5024\u3068\u50be\u304d\u306e\u4fc2\u6570\u306e\u5024\u3092\u5f97\u308b\u306b\u306f\u3069\u306e<br>\u3088\u3046\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3051\u3070\u3044\u3044\u3067\u3059\u304b\uff1fX\u8ef8\u306bhp\u3001Y\u8ef8\u306bmpg\u3068\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/summary><div class=\"liquid-accordion-bottom\">\n<p><code>lm()<\/code> \u95a2\u6570\u3092\u4f7f\u3063\u3066\u3001<code>hp<\/code> \u3092 X \u8ef8\u3001<code>mpg<\/code> \u3092 Y \u8ef8\u3068\u3059\u308b\u7dda\u5f62\u56de\u5e30\u306e\u5207\u7247\uff08intercept\uff09\u3068\u50be\u304d\uff08coefficient\uff09\u3092\u6c42\u3081\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># mtcars\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u30ed\u30fc\u30c9\ndata(mtcars)\n\n# \u7dda\u5f62\u56de\u5e30\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\uff08mpg\u3092\u76ee\u7684\u5909\u6570\u3001hp\u3092\u8aac\u660e\u5909\u6570\uff09\nmodel &lt;- lm(mpg ~ hp, data = mtcars)\n\n# \u56de\u5e30\u4fc2\u6570\uff08\u5207\u7247\u3068\u50be\u304d\uff09\u3092\u53d6\u5f97\ncoefficients &lt;- coef(model)\n\n# \u4fc2\u6570\u306e\u8868\u793a\nprint(coefficients)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u8aac\u660e\uff1a<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>lm(mpg ~ hp, data = mtcars)<\/code> \u3067 <code>mpg<\/code> \u3092\u76ee\u7684\u5909\u6570\uff08Y \u8ef8\uff09\u3001<code>hp<\/code> \u3092\u8aac\u660e\u5909\u6570\uff08X \u8ef8\uff09\u3068\u3057\u3066\u7dda\u5f62\u56de\u5e30\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>coef(model)<\/code> \u3092\u4f7f\u3063\u3066\u5207\u7247\uff08intercept\uff09\u3068\u50be\u304d\u306e\u4fc2\u6570\uff08slope\uff09\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>print(coefficients)<\/code> \u3067\u7d50\u679c\u3092\u8868\u793a\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u51fa\u529b\u3055\u308c\u308b\u5024\u306f\u4ee5\u4e0b\u306e\u5f62\u5f0f\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>(Intercept)          hp  \n  X.XXXXXXX      Y.YYYYYY  <\/code><\/pre>\n\n\n\n<p>\u3053\u3053\u3067 <code>(Intercept)<\/code> \u306f\u5207\u7247\u306e\u5024\u3001<code>hp<\/code> \u306f\u50be\u304d\u306e\u4fc2\u6570\u3092\u793a\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3082\u3057\u3001\u56de\u5e30\u30e2\u30c7\u30eb\u306e\u8a73\u7d30\u306a\u7d71\u8a08\u60c5\u5831\u3082\u78ba\u8a8d\u3057\u305f\u3044\u5834\u5408\u306f\u3001<code>summary(model)<\/code> \u3092\u5b9f\u884c\u3059\u308b\u3068\u3001p \u5024\u3084\u6c7a\u5b9a\u4fc2\u6570 (<code>R-squared<\/code>) \u306a\u3069\u3082\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>summary(model)<\/code><\/pre>\n\n\n\n<p>\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3084\u53ef\u8996\u5316\u306e\u65b9\u6cd5\u306a\u3069\u3001\u3055\u3089\u306b\u8a73\u3057\u304f\u77e5\u308a\u305f\u3044\u3053\u3068\u304c\u3042\u308c\u3070\u3001\u304a\u6c17\u8efd\u306b\u805e\u3044\u3066\u304f\u3060\u3055\u3044\uff01<\/p>\n<\/div><\/details>\n\n\n\n<p>lm()\u95a2\u6570\u3092\u7528\u3044\u3066\u3001\u76f4\u7dda\u56de\u5e30\u306e\u5206\u6790\u7d50\u679c\u3092\u5909\u6570model\u306b\u683c\u7d0d\u3057\u3001coef(model)\u3067\u5207\u7247\u3068\u50be\u304d\u304c\u5f97\u3089\u308c\u308b\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u305d\u306e\u307e\u307e\u5b9f\u884c\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u7d50\u679c\u304c\u30b3\u30f3\u30bd\u30fc\u30eb\u306b\u51fa\u529b\u3055\u308c\u307e\u3057\u305f\u3002summary(model)\u3067p\u5024\u3001\u6c7a\u5b9a\u4fc2\u6570\u3082\u51fa\u529b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"808\" height=\"699\" src=\"https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-8.png\" alt=\"\" class=\"wp-image-1682\" srcset=\"https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-8.png 808w, https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-8-300x260.png 300w, https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-8-768x664.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/figure>\n\n\n\n<p>\u305d\u308c\u3067\u306f\u3001\u71c3\u8cbbmpg\u3092\u5f93\u5c5e\u5909\u6570\u3068\u3057\u3066\u3001\u305d\u308c\u4ee5\u5916\u306e\u5909\u6570\u3092\u8aac\u660e\u5909\u6570\u306b\u3057\u3066\u91cd\u56de\u5e30\u5206\u6790\u3092\u3059\u308b\u306b\u306f\u3069\u306e\u3088\u3046\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3051\u3070\u3044\u3044\u304bCopilot\u306b\u805e\u3044\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<details class=\"wp-block-liquid-accordion\" style=\"border-color:#00aeef\"><summary class=\"liquid-accordion-top\" style=\"color:#333333;background-color:#00aeef\">mpg\u3092\u5f93\u5c5e\u5909\u6570\u3068\u3057\u3066\u3001\u305d\u308c\u4ee5\u5916\u306e\u5909\u6570\u3092\u8aac\u660e\u5909\u6570\u306b\u3057\u3066\u91cd\u56de\u5e30\u5206\u6790\u3092<br>\u3059\u308b\u306b\u306f\u3069\u306e\u3088\u3046\u306a\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u66f8\u3051\u3070\u3044\u3044\u3067\u3059\u304b\uff1f\u5207\u7247\u3001\u4fc2\u6570\u3001p\u5024\u3001<br>\u6c7a\u5b9a\u4fc2\u6570\u306e\u5024\u3082\u51fa\u529b\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/summary><div class=\"liquid-accordion-bottom\">\n<p>\u9078<code>lm()<\/code> \u95a2\u6570\u3092\u4f7f\u3063\u3066 <code>mpg<\/code> \u3092\u5f93\u5c5e\u5909\u6570\uff08\u76ee\u7684\u5909\u6570\uff09\u3068\u3057\u3066\u3001\u305d\u308c\u4ee5\u5916\u306e\u5909\u6570\u3092\u8aac\u660e\u5909\u6570\uff08\u72ec\u7acb\u5909\u6570\uff09\u306b\u8a2d\u5b9a\u3057\u3001\u91cd\u56de\u5e30\u5206\u6790\u3092\u884c\u3044\u3001\u5207\u7247\u30fb\u56de\u5e30\u4fc2\u6570\u30fbp\u5024\u30fb\u6c7a\u5b9a\u4fc2\u6570\u3092\u51fa\u529b\u3059\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5fc5\u8981\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30ed\u30fc\u30c9\ndata(mtcars)\n\n# \u7dda\u5f62\u56de\u5e30\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\uff08mpg\u3092\u5f93\u5c5e\u5909\u6570\u3001\u305d\u306e\u4ed6\u306e\u5909\u6570\u3092\u8aac\u660e\u5909\u6570\u306b\u8a2d\u5b9a\uff09\nmodel &lt;- lm(mpg ~ ., data = mtcars)\n\n# \u56de\u5e30\u30e2\u30c7\u30eb\u306e\u6982\u8981\u3092\u8868\u793a\nsummary_model &lt;- summary(model)\n\n# \u5207\u7247\u3068\u56de\u5e30\u4fc2\u6570\u3092\u53d6\u5f97\ncoefficients &lt;- coef(model)\n\n# p\u5024\u3092\u53d6\u5f97\np_values &lt;- summary_model$coefficients&#91;,4]\n\n# \u6c7a\u5b9a\u4fc2\u6570\u3092\u53d6\u5f97\nr_squared &lt;- summary_model$r.squared\n\n# \u7d50\u679c\u3092\u51fa\u529b\nprint(\"\u56de\u5e30\u4fc2\u6570\uff08\u5207\u7247\u3068\u50be\u304d\uff09:\")\nprint(coefficients)\n\nprint(\"p\u5024:\")\nprint(p_values)\n\nprint(\"\u6c7a\u5b9a\u4fc2\u6570 (R-squared):\")\nprint(r_squared)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u8aac\u660e\uff1a<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>lm(mpg ~ ., data = mtcars)<\/code> \u3067 <code>mpg<\/code> \u3092\u5f93\u5c5e\u5909\u6570\u3068\u3057\u3001\u4ed6\u306e\u5909\u6570\u3092\u8aac\u660e\u5909\u6570\u3068\u3057\u3066\u91cd\u56de\u5e30\u5206\u6790\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>summary(model)<\/code> \u3092\u53d6\u5f97\u3057\u3001\u56de\u5e30\u4fc2\u6570\u30fbp\u5024\u30fb\u6c7a\u5b9a\u4fc2\u6570 (<code>R-squared<\/code>) \u3092\u62bd\u51fa\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>summary_model$coefficients[,4]<\/code> \u3067 p\u5024\u3092\u53d6\u5f97\u3067\u304d\u307e\u3059\uff08\u5404\u8aac\u660e\u5909\u6570\u306b\u5bfe\u3059\u308b\u7d71\u8a08\u7684\u6709\u610f\u6027\uff09\u3002<\/li>\n\n\n\n<li><code>summary_model$r.squared<\/code> \u3067\u6c7a\u5b9a\u4fc2\u6570\u3092\u53d6\u5f97\u3057\u3001\u30e2\u30c7\u30eb\u306e\u9069\u5408\u5ea6\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>print()<\/code> \u306b\u3088\u308a\u7d50\u679c\u3092\u8868\u793a\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u3053\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u5404\u5909\u6570\u306e\u56de\u5e30\u4fc2\u6570\u3001p\u5024\u3001\u6c7a\u5b9a\u4fc2\u6570\u306e\u5024\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002\u30e2\u30c7\u30eb\u306e\u8a55\u4fa1\u3084\u5909\u6570\u306e\u9078\u629e\u306b\u3064\u3044\u3066\u3082\u76f8\u8ac7\u3067\u304d\u307e\u3059\u306e\u3067\u3001\u6c17\u8efd\u306b\u805e\u3044\u3066\u304f\u3060\u3055\u3044\u306d\uff01\u629e\u306b\u3064\u3044\u3066\u3082\u76f8\u8ac7\u3067\u304d\u307e\u3059\u306e\u3067\u3001\u6c17\u8efd\u306b\u805e\u3044\u3066\u304f\u3060\u3055\u3044\u306d\uff01<\/p>\n<\/div><\/details>\n\n\n\n<p>\u3053\u308c\u3082\u305d\u306e\u307e\u307e\u30b3\u30d4\u30fc\u30fb\u8cbc\u308a\u4ed8\u3051\u3057\u3066R\u3067\u5b9f\u884c\u3057\u305f\u7d50\u679c\u304c\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002\u6c7a\u5b9a\u4fc2\u6570\u306f0.869\u3067\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"898\" height=\"864\" src=\"https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-9.png\" alt=\"\" class=\"wp-image-1683\" srcset=\"https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-9.png 898w, https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-9-300x289.png 300w, https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-9-768x739.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p>\u305d\u308c\u3067\u306f\u3001\u6700\u5f8c\u306b\u71c3\u8cbbmpg\u3092\u5f93\u5c5e\u5909\u6570\u3068\u3057\u3066\u3001\u8aac\u660e\u5909\u6570\u306bhp\u3001wt\u3001qsec\u3001am\u306e4\u3064\u3060\u3051\u3067\u30e2\u30c7\u30eb\u3092\u4f5c\u308b\u5834\u5408\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092Copilot\u306b\u66f8\u3044\u3066\u3082\u3089\u3044\u307e\u3059\u3002\u3053\u308c\u30894\u3064\u306e\u8aac\u660e\u5909\u6570\u306f\u4e0a\u8a18\u306ep\u5024\u304c\u5c0f\u3055\u3044\u3082\u306e\u3092\u9078\u3073\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<details class=\"wp-block-liquid-accordion\" style=\"border-color:#00aeef\"><summary class=\"liquid-accordion-top\" style=\"color:#333333;background-color:#00aeef\">mpg\u3092\u5f93\u5c5e\u5909\u6570\u3068\u3057\u3066\u3001\u8aac\u660e\u5909\u6570\u306bhp\u3001wt\u3001qsec\u3001am\u306e4\u3064\u3060\u3051\u3067<br>\u30e2\u30c7\u30eb\u3092\u4f5c\u308b\u5834\u5408\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u306f\uff1f<\/summary><div class=\"liquid-accordion-bottom\">\n<p><code>lm()<\/code>\u95a2\u6570\u3092\u4f7f\u3044\u3001<code>mpg<\/code>\u3092\u5f93\u5c5e\u5909\u6570\u3068\u3057\u3066\u3001<code>hp<\/code>\u3001<code>wt<\/code>\u3001<code>qsec<\/code>\u3001<code>am<\/code>\u306e4\u3064\u3092\u8aac\u660e\u5909\u6570\u306b\u8a2d\u5b9a\u3057\u3066\u91cd\u56de\u5e30\u5206\u6790\u3092\u884c\u3046\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># mtcars\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u3092\u30ed\u30fc\u30c9\ndata(mtcars)\n\n# \u7dda\u5f62\u56de\u5e30\u30e2\u30c7\u30eb\u3092\u4f5c\u6210\uff08mpg\u3092\u5f93\u5c5e\u5909\u6570\u3001hp, wt, qsec, am \u3092\u8aac\u660e\u5909\u6570\u3068\u3057\u3066\u8a2d\u5b9a\uff09\nmodel &lt;- lm(mpg ~ hp + wt + qsec + am, data = mtcars)\n\n# \u30e2\u30c7\u30eb\u306e\u8981\u7d04\u3092\u8868\u793a\nsummary(model)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u8aac\u660e\uff1a<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>lm(mpg ~ hp + wt + qsec + am, data = mtcars)<\/code> \u3067 <code>mpg<\/code> \u3092\u5f93\u5c5e\u5909\u6570\u3001<code>hp<\/code>\u3001<code>wt<\/code>\u3001<code>qsec<\/code>\u3001<code>am<\/code> \u3092\u8aac\u660e\u5909\u6570\u306b\u8a2d\u5b9a\u3057\u3001\u91cd\u56de\u5e30\u5206\u6790\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/li>\n\n\n\n<li><code>summary(model)<\/code> \u3092\u5b9f\u884c\u3059\u308b\u3068\u3001\u56de\u5e30\u4fc2\u6570\uff08\u5207\u7247\u3068\u5404\u5909\u6570\u306e\u50be\u304d\uff09\u3001p\u5024\u3001\u6c7a\u5b9a\u4fc2\u6570\u306a\u3069\u306e\u7d71\u8a08\u60c5\u5831\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u30e2\u30c7\u30eb\u306e\u8a55\u4fa1\u3084\u5909\u6570\u306e\u9078\u629e\u306b\u3064\u3044\u3066\u3055\u3089\u306b\u8a73\u3057\u304f\u77e5\u308a\u305f\u3044\u5834\u5408\u306f\u3001\u304a\u6c17\u8efd\u306b\u805e\u3044\u3066\u304f\u3060\u3055\u3044\uff01<\/p>\n<\/div><\/details>\n\n\n\n<p>\u3053\u3053\u3067\u306f\u3001model = lm(mpg ~ hp + wt + qsec + am, data = mtcars)\u3068\u3044\u3046\u8a18\u8ff0\u65b9\u6cd5\u306b\u6ce8\u76ee\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u591a\u5909\u91cf\u306e\u30e2\u30c7\u30eb\u306e\u6307\u5b9a\u65b9\u6cd5\u3067\u3059\u3002\u3053\u308c\u3089\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u3001R\u3067\u5b9f\u884c\u3057\u305f\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"871\" height=\"631\" src=\"https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-10.png\" alt=\"\" class=\"wp-image-1684\" srcset=\"https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-10.png 871w, https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-10-300x217.png 300w, https:\/\/info.zanet.biz\/wp\/wp-content\/uploads\/2025\/05\/image-10-768x556.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p>\u5404\u5909\u6570\u306e\u610f\u5473\u3092\u8868\u306b\u3057\u3066\u3082\u3089\u3046\u306e\u3092Copilot\u306b\u983c\u3093\u3067\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n\n\n\n<details class=\"wp-block-liquid-accordion\" style=\"border-color:#00aeef\"><summary class=\"liquid-accordion-top\" style=\"color:#333333;background-color:#00aeef\">mtcars\u306e\u5404\u5909\u6570\u304c\u4f55\u3092\u8868\u3057\u3066\u3044\u308b\u304b\u8868\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/summary><div class=\"liquid-accordion-bottom\">\n<p>\u3082\u3061\u308d\u3093\u3067\u3059\uff01<code>mtcars<\/code> \u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306b\u542b\u307e\u308c\u308b\u5404\u5909\u6570\u306e\u610f\u5473\u3092\u8868\u306b\u307e\u3068\u3081\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u5909\u6570\u540d<\/th><th>\u8aac\u660e<\/th><\/tr><\/thead><tbody><tr><td><code>mpg<\/code><\/td><td>\u71c3\u8cbb (Miles Per Gallon)<\/td><\/tr><tr><td><code>cyl<\/code><\/td><td>\u30b7\u30ea\u30f3\u30c0\u30fc\u6570<\/td><\/tr><tr><td><code>disp<\/code><\/td><td>\u6392\u6c17\u91cf (cubic inches)<\/td><\/tr><tr><td><code>hp<\/code><\/td><td>\u99ac\u529b (Horsepower)<\/td><\/tr><tr><td><code>drat<\/code><\/td><td>\u30ea\u30a2\u30a2\u30af\u30b9\u30eb\u6bd4 (Rear Axle Ratio)<\/td><\/tr><tr><td><code>wt<\/code><\/td><td>\u8eca\u4e21\u91cd\u91cf (1000\u30dd\u30f3\u30c9\u5358\u4f4d)<\/td><\/tr><tr><td><code>qsec<\/code><\/td><td>1\/4\u30de\u30a4\u30eb\u8d70\u884c\u6642\u9593\uff08\u79d2\uff09<\/td><\/tr><tr><td><code>vs<\/code><\/td><td>\u30a8\u30f3\u30b8\u30f3\u306e\u5f62\u72b6 (<code>0<\/code> = V\u578b, <code>1<\/code> = \u76f4\u5217\u578b)<\/td><\/tr><tr><td><code>am<\/code><\/td><td>\u5909\u901f\u6a5f\u306e\u7a2e\u985e (<code>0<\/code> = \u30aa\u30fc\u30c8\u30de, <code>1<\/code> = \u30de\u30cb\u30e5\u30a2\u30eb)<\/td><\/tr><tr><td><code>gear<\/code><\/td><td>\u30ae\u30a2\u6570<\/td><\/tr><tr><td><code>carb<\/code><\/td><td>\u30ad\u30e3\u30d6\u30ec\u30bf\u30fc\u6570<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u3053\u306e\u30c7\u30fc\u30bf\u30bb\u30c3\u30c8\u306f\u3001\u81ea\u52d5\u8eca\u306e\u6027\u80fd\u3092\u5206\u6790\u3059\u308b\u305f\u3081\u306b\u5e83\u304f\u4f7f\u308f\u308c\u3066\u3044\u307e\u3059\u3002\u7279\u306b\u3001<code>mpg<\/code> (\u71c3\u8cbb) \u3068\u4ed6\u306e\u5909\u6570\u306e\u95a2\u4fc2\u3092\u8abf\u3079\u308b\u3053\u3068\u3067\u3001\u71c3\u8cbb\u306b\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u8981\u56e0\u3092\u5206\u6790\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4ed6\u306b\u8a73\u3057\u304f\u77e5\u308a\u305f\u3044\u3053\u3068\u304c\u3042\u308c\u3070\u3001\u6c17\u8efd\u306b\u805e\u3044\u3066\u304f\u3060\u3055\u3044\u306d\uff01<\/p>\n<\/div><\/details>\n\n\n\n<p><\/p>\n\n\n\n<p>\u3053\u308c\u3089\u306e\u5909\u6570\u306e\u610f\u5473\u304b\u3089\u7d50\u679c\u3092\u8003\u5bdf\u3059\u308b\u3068\u3001\u99ac\u529b\u3068\u8eca\u4e21\u91cd\u91cf\u306b\u5bfe\u3059\u308b\u4fc2\u6570\u306f\u30de\u30a4\u30ca\u30b9\u306a\u306e\u3067\u3001\u3053\u308c\u3089\u306e\u5024\u304c\u5927\u304d\u3044\u307b\u3069\u71c3\u8cbb\u306f\u60aa\u304f\u306a\u308b\u3001\u30aa\u30fc\u30c8\u30de\uff080\uff09\u306b\u5bfe\u3057\u3066\u30de\u30cb\u30e5\u30a2\u30eb\uff081\uff09\u306f\u4fc2\u6570\u304c\u30d7\u30e9\u30b9\u306a\u306e\u3067\u3001\u30de\u30cb\u30e5\u30a2\u30eb\u306e\u65b9\u304c\u71c3\u8cbb\u304c\u3044\u3044\u30011\/4\u30de\u30a4\u30eb\u8d70\u884c\u6642\u9593\u3001\u3059\u306a\u308f\u30610-4\u306e\u6642\u9593\u304c\u9577\u304f\u3001\u52a0\u901f\u304c\u60aa\u3044\u307b\u3069\u71c3\u8cbb\u304c\u3044\u3044\u3001\u3068\u3044\u3046\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002\u8abf\u6574\u6c7a\u5b9a\u4fc2\u6570\u304c0.8368\u3067\u3053\u308c\u30894\u3064\u306e\u56e0\u5b50\u3067\u71c3\u8cbb\u306e\u5927\u90e8\u5206\u304c\u6c7a\u307e\u308b\u3068\u3044\u3046\u3053\u3068\u304c\u5206\u304b\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u533b\u5b66\u7814\u7a76\u3067\u3082\u76f8\u95a2\u3001\u76f4\u7dda\u56de\u5e30\u3001\u91cd\u56de\u5e30\u5206\u6790\u304c\u9069\u7528\u3055\u308c\u308b\u4f8b\u306f\u591a\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u307e\u305f\u3001\u6563\u5e03\u56f3\u3092\u63cf\u3044\u3066\u8996\u899a\u7684\u306b\u691c\u8a0e\u3059\u308b\u3053\u3068\u3082\u591a\u3044\u3068\u601d\u3044\u307e\u3059\u3002\u4eca\u56de\u306e\u4f8b\u3067\u3082\u3001Copilot\u306b\u805e\u304d\u306a\u304c\u3089R\u3067\u89e3\u6790\u3092\u9032\u3081\u3066\u3044\u304f\u306e\u306f\u6709\u7528\u3068\u601d\u308f\u3055\u308c\u307e\u3057\u305f\u3002\u4eca\u56de\u306e\u4f8b\u306f\u533b\u5b66\u306e\u4f8b\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001\u5fdc\u7528\u306f\u5bb9\u6613\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>Copilot\u306fR\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u90e8\u5206\u306f\u3001\u30b3\u30d4\u30fc\u7528\u306e\u30dc\u30bf\u30f3\u304c\u3064\u3044\u3066\u304a\u308a\u3001\u305d\u308c\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001R\u3067\u8cbc\u308a\u4ed8\u3051\u308b\u3060\u3051\u3067\u3059\u3050\u5b9f\u884c\u3067\u304d\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u81ea\u5206\u3067\u66f8\u304d\u8fbc\u3080\u5fc5\u8981\u304c\u7121\u304f\u306a\u308a\u3001\u52b9\u7387\u5316\u304c\u56f3\u308c\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u56de\u306f\u3001Copilot\u306bR\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u63d0\u6848\u3057\u3066\u3082\u3089\u3044\u307e\u3057\u3087\u3046\u3002 \u9752\u306e\u30dc\u30c3\u30af\u30b9\u5185\u306b\u66f8\u3044\u3066\u3042\u308b\u306e\u304c\u30d7\u30ed\u30f3\u30d7\u30c8\u3067\u3059\u3002\u53f3\u7aef\u306e\u30a2\u30a4\u30b3\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068Copilot\u306e\u56de\u7b54\u3092\u8868\u793a\u3057\u305f\u308a\u96a0\u3057\u305f\u308a\u3067\u304d\u307e\u3059\u3002\u305d\u306e\u4e0b\u306b\u306fR\u3067\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u306e &hellip; <a href=\"https:\/\/info.zanet.biz\/?p=1676\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;Copilot\u3067R\u306e\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u4f5c\u6210\u3059\u308b\uff1a\u76f8\u95a2\u3001\u6563\u5e03\u56f3\u3001\u76f4\u7dda\u56de\u5e30\u3001\u91cd\u56de\u5e30&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[32],"tags":[],"class_list":["post-1676","post","type-post","status-publish","format-standard","hentry","category-statistics"],"_links":{"self":[{"href":"https:\/\/info.zanet.biz\/index.php?rest_route=\/wp\/v2\/posts\/1676","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/info.zanet.biz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/info.zanet.biz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/info.zanet.biz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/info.zanet.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1676"}],"version-history":[{"count":5,"href":"https:\/\/info.zanet.biz\/index.php?rest_route=\/wp\/v2\/posts\/1676\/revisions"}],"predecessor-version":[{"id":1689,"href":"https:\/\/info.zanet.biz\/index.php?rest_route=\/wp\/v2\/posts\/1676\/revisions\/1689"}],"wp:attachment":[{"href":"https:\/\/info.zanet.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/info.zanet.biz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/info.zanet.biz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}