{"id":414,"date":"2023-03-28T14:34:19","date_gmt":"2023-03-28T14:34:19","guid":{"rendered":"https:\/\/yunshangtulv.com.cn\/?p=414"},"modified":"2023-03-28T14:35:26","modified_gmt":"2023-03-28T14:35:26","slug":"r%e8%af%ad%e8%a8%80%e5%9f%ba%e7%a1%80%e7%bb%98%e5%9b%be%ef%bc%9a%e6%95%a3%e7%82%b9%e5%9b%be","status":"publish","type":"post","link":"https:\/\/yunshangtulv.com.cn\/?p=414","title":{"rendered":"R\u8bed\u8a00\u57fa\u7840\u7ed8\u56fe\uff1a\u6563\u70b9\u56fe"},"content":{"rendered":"<p>\u9996\u5148\uff0c\u6563\u70b9\u56fe\u662f\u4e00\u79cd\u5e38\u7528\u7684\u6570\u636e\u53ef\u89c6\u5316\u65b9\u6cd5\uff0c\u7528\u4e8e\u663e\u793a\u4e24\u4e2a\u53d8\u91cf\u4e4b\u95f4\u7684\u5173\u7cfb\u3002\u5728\u6563\u70b9\u56fe\u4e2d\uff0c\u6bcf\u4e2a\u89c2\u5bdf\u70b9\u90fd\u7528\u4e00\u4e2a\u70b9\u8868\u793a\uff0c\u4e00\u4e2a\u8f74\u8868\u793a\u4e00\u4e2a\u53d8\u91cf\u3002\u5982\u679c\u4e24\u4e2a\u53d8\u91cf\u4e4b\u95f4\u5b58\u5728\u67d0\u79cd\u5173\u7cfb\uff0c\u90a3\u4e48\u70b9\u7684\u5206\u5e03\u5c06\u5448\u73b0\u51fa\u7279\u5b9a\u7684\u6a21\u5f0f\u3002<\/p>\n<p>\u5728R\u8bed\u8a00\u4e2d\u521b\u5efa\u6563\u70b9\u56fe\u7684\u57fa\u672c\u65b9\u6cd5\u662f\u4f7f\u7528<code>plot()<\/code>\u51fd\u6570\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u793a\u4f8b\uff1a<\/p>\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-R\"><code class=\"!whitespace-pre hljs language-R\"><span class=\"hljs-comment\"># \u521b\u5efa\u865a\u62df\u6570\u636e<\/span><br \/>\nx <span class=\"hljs-operator\">&lt;-<\/span> <span class=\"hljs-built_in\">c<\/span><span class=\"hljs-punctuation\">(<\/span><span class=\"hljs-number\">1<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-number\">2<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-number\">3<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-number\">4<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-number\">5<\/span><span class=\"hljs-punctuation\">)<\/span><br \/>\ny <span class=\"hljs-operator\">&lt;-<\/span> <span class=\"hljs-built_in\">c<\/span><span class=\"hljs-punctuation\">(<\/span><span class=\"hljs-number\">2<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-number\">4<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-number\">6<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-number\">8<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-number\">10<\/span><span class=\"hljs-punctuation\">)<\/span><\/code><\/code><span class=\"hljs-comment\"># \u7ed8\u5236\u6563\u70b9\u56fe<\/span><br \/>\nplot<span class=\"hljs-punctuation\">(<\/span>x<span class=\"hljs-punctuation\">,<\/span> y<span class=\"hljs-punctuation\">)<\/span><\/p>\n<\/div>\n<\/div>\n<p>\u8981\u5b9a\u5236\u548c\u4f18\u5316\u6563\u70b9\u56fe\u7684\u663e\u793a\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u65b9\u6cd5\uff1a<\/p>\n<ol>\n<li>\u66f4\u6539\u70b9\u7684\u5f62\u72b6\u548c\u989c\u8272\uff1a\u4f7f\u7528<code>pch<\/code>\u53c2\u6570\u9009\u62e9\u4e0d\u540c\u7684\u70b9\u5f62\u72b6\uff0c<code>col<\/code>\u53c2\u6570\u66f4\u6539\u989c\u8272\u3002\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-R\">plot<span class=\"hljs-punctuation\">(<\/span>x<span class=\"hljs-punctuation\">,<\/span> y<span class=\"hljs-punctuation\">,<\/span> pch <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-number\">19<\/span><span class=\"hljs-punctuation\">,<\/span> col <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-string\">\"red\"<\/span><span class=\"hljs-punctuation\">)<\/span><br \/>\n<\/code><\/div>\n<\/div>\n<\/li>\n<li>\u6dfb\u52a0\u8f74\u6807\u7b7e\u548c\u6807\u9898\uff1a\u4f7f\u7528<code>xlab<\/code>\u548c<code>ylab<\/code>\u53c2\u6570\u66f4\u6539\u8f74\u6807\u7b7e\uff0c<code>main<\/code>\u53c2\u6570\u6dfb\u52a0\u6807\u9898\u3002\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-R\">plot<span class=\"hljs-punctuation\">(<\/span>x<span class=\"hljs-punctuation\">,<\/span> y<span class=\"hljs-punctuation\">,<\/span> xlab <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-string\">\"X\u8f74\u6807\u7b7e\"<\/span><span class=\"hljs-punctuation\">,<\/span> ylab <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-string\">\"Y\u8f74\u6807\u7b7e\"<\/span><span class=\"hljs-punctuation\">,<\/span> main <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-string\">\"\u6563\u70b9\u56fe\u6807\u9898\"<\/span><span class=\"hljs-punctuation\">)<\/span><br \/>\n<\/code><\/div>\n<\/div>\n<\/li>\n<li>\u66f4\u6539\u8f74\u8303\u56f4\uff1a\u4f7f\u7528<code>xlim<\/code>\u548c<code>ylim<\/code>\u53c2\u6570\u6307\u5b9a\u8f74\u8303\u56f4\u3002\n<div class=\"bg-black rounded-md mb-4\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans justify-between rounded-t-md\"><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-R\">plot<span class=\"hljs-punctuation\">(<\/span>x<span class=\"hljs-punctuation\">,<\/span> y<span class=\"hljs-punctuation\">,<\/span> xlim <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-built_in\">c<\/span><span class=\"hljs-punctuation\">(<\/span><span class=\"hljs-number\">0<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-number\">6<\/span><span class=\"hljs-punctuation\">)<\/span><span class=\"hljs-punctuation\">,<\/span> ylim <span class=\"hljs-operator\">=<\/span> <span class=\"hljs-built_in\">c<\/span><span class=\"hljs-punctuation\">(<\/span><span class=\"hljs-number\">0<\/span><span class=\"hljs-punctuation\">,<\/span> <span class=\"hljs-number\">12<\/span><span class=\"hljs-punctuation\">)<\/span><span class=\"hljs-punctuation\">)<\/span><br \/>\n<\/code><\/div>\n<\/div>\n<\/li>\n<\/ol>\n<p><img decoding=\"async\" src=\"https:\/\/yunshangtulv.com.cn\/wp-content\/uploads\/2023\/03\/1680014002154.webp\" \/><\/p>\n<p>\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5b9e\u9645\u5e94\u7528\u6848\u4f8b\uff1a<\/p>\n<ol>\n<li>\u63a2\u7d22\u623f\u4ef7\u4e0e\u623f\u5c4b\u9762\u79ef\u7684\u5173\u7cfb\uff1a\u6536\u96c6\u4e00\u4e9b\u623f\u5730\u4ea7\u6570\u636e\uff0c\u5c06\u623f\u4ef7\u4f5c\u4e3aY\u8f74\uff0c\u623f\u5c4b\u9762\u79ef\u4f5c\u4e3aX\u8f74\uff0c\u7ed8\u5236\u6563\u70b9\u56fe\u3002\u8fd9\u5c06\u6709\u52a9\u4e8e\u4e86\u89e3\u623f\u4ef7\u4e0e\u623f\u5c4b\u9762\u79ef\u4e4b\u95f4\u7684\u5173\u7cfb\u3002<\/li>\n<li>\u5206\u6790\u6c14\u6e29\u4e0e\u6d77\u62d4\u7684\u5173\u7cfb\uff1a\u6536\u96c6\u4e0d\u540c\u5730\u70b9\u7684\u6c14\u6e29\u548c\u6d77\u62d4\u6570\u636e\uff0c\u5c06\u6c14\u6e29\u4f5c\u4e3aY\u8f74\uff0c\u6d77\u62d4\u4f5c\u4e3aX\u8f74\uff0c\u7ed8\u5236\u6563\u70b9\u56fe\u3002\u8fd9\u5c06\u6709\u52a9\u4e8e\u4e86\u89e3\u6c14\u6e29\u4e0e\u6d77\u62d4\u4e4b\u95f4\u7684\u5173\u7cfb\u3002<\/li>\n<li>\u7814\u7a76\u5e7f\u544a\u6295\u5165\u4e0e\u9500\u552e\u989d\u7684\u5173\u7cfb\uff1a\u6536\u96c6\u5e7f\u544a\u6295\u5165\u548c\u9500\u552e\u989d\u6570\u636e\uff0c\u5c06\u5e7f\u544a\u6295\u5165\u4f5c\u4e3aX\u8f74\uff0c\u9500\u552e\u989d\u4f5c\u4e3aY\u8f74\uff0c\u7ed8\u5236\u6563\u70b9\u56fe\u3002\u8fd9\u5c06\u6709\u52a9\u4e8e\u4e86\u89e3\u5e7f\u544a\u6295\u5165\u5bf9\u9500\u552e\u989d\u7684\u5f71\u54cd\u3002<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148\uff0c\u6563\u70b9\u56fe\u662f\u4e00\u79cd\u5e38\u7528\u7684\u6570\u636e\u53ef\u89c6\u5316\u65b9\u6cd5\uff0c\u7528\u4e8e\u663e\u793a\u4e24\u4e2a\u53d8\u91cf\u4e4b\u95f4\u7684\u5173\u7cfb\u3002\u5728\u6563\u70b9\u56fe\u4e2d\uff0c\u6bcf\u4e2a\u89c2\u5bdf\u70b9\u90fd\u7528\u4e00\u4e2a\u70b9\u8868\u793a\uff0c\u4e00\u4e2a [&hellip;]<\/p>\n","protected":false},"author":111,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-414","post","type-post","status-publish","format-standard","hentry","category-r"],"_links":{"self":[{"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/414","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=\/wp\/v2\/users\/111"}],"replies":[{"embeddable":true,"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=414"}],"version-history":[{"count":0,"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/414\/revisions"}],"wp:attachment":[{"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=414"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=414"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}