{"id":3157,"date":"2013-10-12T17:23:32","date_gmt":"2013-10-12T08:23:32","guid":{"rendered":"http:\/\/peta.okechan.net\/blog\/?p=3157"},"modified":"2013-10-12T17:25:56","modified_gmt":"2013-10-12T08:25:56","slug":"r%e8%a8%80%e8%aa%9e%e3%82%92%e3%81%af%e3%81%98%e3%82%81%e3%82%8b","status":"publish","type":"post","link":"https:\/\/peta.okechan.net\/blog\/archives\/3157","title":{"rendered":"R\u8a00\u8a9e\u3092\u306f\u3058\u3081\u308b"},"content":{"rendered":"<p>Twitter\u3067R\u8a00\u8a9e\u306b\u3064\u3044\u3066\u306e\u8a71\u984c\u304c\u6d41\u308c\u3066\u3044\u305f\u306e\u3092\u898b\u304b\u3051\u3066\u306a\u3093\u3068\u306a\u304f\u3084\u3063\u3066\u307f\u3088\u3046\u304b\u3068\u601d\u3063\u305f\u3002<\/p>\n<p>R\u8a00\u8a9e\u3068\u3044\u3046\u3068\u4f55\u5e74\u3082\u524d\u304b\u3089\u540d\u524d\u3060\u3051\u306f\u77e5\u3063\u3066\u308b\u3051\u3069\u3001\u30d9\u30af\u30c8\u30eb\u51e6\u7406\u306b\u7279\u5316\u3057\u305f\u8a00\u8a9e\u3068\u3044\u3046\u4ee5\u5916\u306f\u4f55\u3082\u77e5\u3089\u306a\u3044\u3002<br \/>\n\u305d\u308c\u3053\u305d\u30b3\u30f3\u30d1\u30a4\u30e9\u65b9\u5f0f\u306a\u306e\u304b\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u65b9\u5f0f\u306a\u306e\u304b\u3001\u305d\u306e\u8fba\u308a\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u540d\uff08\u30b3\u30de\u30f3\u30c9\u540d\uff09\u306f\u4f55\u306a\u306e\u304b\u3055\u3048\u77e5\u3089\u306a\u3044\u3002<\/p>\n<p>\u3067\u3082\u30d9\u30af\u30c8\u30eb\u51e6\u7406\u306b\u7279\u5316\u3057\u305f\u8a00\u8a9e\u306a\u3089\u5f53\u7136\u30d9\u30af\u30c8\u30eb\u51e6\u7406\u304c\u7c21\u5358\u306b\u66f8\u3051\u308b\u3093\u3060\u308d\u3046\u3057\u3001CPU\u3084GPU\u7b49\u306e\u30d7\u30ed\u30bb\u30c3\u30b5\u3082\u4eca\u307e\u3067\u4ee5\u4e0a\u306b\u3055\u3089\u306b\u30b3\u30a2\u6570\u304c\u5897\u3048\u3066\u3044\u304f\u65b9\u5411\u3067\u6027\u80fd\u304c\u5f37\u5316\u3055\u308c\u3066\u3044\u304f\u3067\u3042\u308d\u3046\u4e8b\u3092\u8003\u3048\u308b\u3068\u3001\u4f55\u304b\u5c06\u6765\u6027\u304c\u3042\u308a\u305d\u3046\u306a\u6c17\u304c\u3059\u308b\u3002<br \/>\n\u305d\u308c\u306b\u3001\u624b\u7d9a\u304d\u578b\u8a00\u8a9e\u306e\u8a2d\u8a08\u306b\u95a2\u6570\u578b\u8a00\u8a9e\u3092\u5229\u7528\u3059\u308b\u304c\u5982\u304f\u3001\u6700\u7d42\u7684\u306bC++\u3084CUDA\u3067\u30d9\u30af\u30c8\u30eb\u51e6\u7406\u3092\u884c\u3046\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304f\u306b\u3057\u308d\u3001\u4e8b\u524d\u306bR\u8a00\u8a9e\u3067\u8a2d\u8a08\u7684\u306a\u4e8b\u304c\u3067\u304d\u305f\u3089\u8272\u3005\u3088\u308d\u3057\u3044\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u601d\u3046\u3002<br \/>\n\u307e\u3041\u4f55\u3082\u77e5\u3089\u306a\u3044\u306e\u3067\u3053\u3046\u3044\u3046\u7528\u9014\u306b\u4f7f\u3048\u308b\u304b\u306f\u5168\u304f\u5206\u304b\u3089\u306a\u3044\u3051\u3069\u3002<\/p>\n<p>\u3053\u3046\u3044\u3046\u5168\u304f\u77e5\u3089\u306a\u3044\u3082\u306e\u306b\u95a2\u3057\u3066\u8abf\u3079\u59cb\u3081\u308b\u306b\u306fWikipedia\u306f\u5f79\u306b\u7acb\u3064\u3002<br \/>\n\u3068\u3044\u3046\u3053\u3068\u3067\u3068\u308a\u3042\u3048\u305aR\u8a00\u8a9e\u306e\u30da\u30fc\u30b8\u306b\u3064\u3044\u3066\u898b\u3066\u307f\u308b\u3002<br \/>\n<a href=\"http:\/\/ja.wikipedia.org\/wiki\/R%E8%A8%80%E8%AA%9E\" target=\"_blank\">R\u8a00\u8a9e &#8211; Wikipedia<\/a><\/p>\n<p>\u3060\u3044\u3076\u5145\u5b9f\u3057\u3066\u308b\u611f\u306f\u3042\u308b\u304c\u3001\u4eca\u56de\u306f\u624b\u5143\u306eMac\u3067R\u8a00\u8a9e\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u3068\u308a\u3042\u3048\u305a\u5b9f\u884c\u51fa\u6765\u308b\u3068\u3053\u308d\u307e\u3067\u884c\u3051\u308c\u3070\u3044\u3044\u306a\u3068\u601d\u3063\u3066\u308b\u306e\u3067\u3001\u305d\u308c\u306b\u5fc5\u8981\u305d\u3046\u306a\u3068\u3053\u308d\u3060\u3051\u898b\u3066\u307f\u308b\u3002<\/p>\n<p>\u307e\u305a\u306f\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3002<br \/>\n\u4e0a\u8a18\u306e\u30da\u30fc\u30b8\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5186\u5468\u7387\u3092\u30e2\u30f3\u30c6\u30ab\u30eb\u30ed\u6cd5\u3067\u8fd1\u4f3c\u3059\u308b\u8a08\u7b97\u306e\u4f8b\u304c\u8f09\u3063\u3066\u3044\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">s&lt;-100000\r\nx&lt;-runif(s)\r\ny&lt;-runif(s)\r\nsum(x^2+y^2&lt;=1)*4\/s<\/pre>\n<p>\u4ee3\u5165\u3092&lt;-\u3068\u66f8\u304f\u3068\u3053\u308d\uff08=\u3067\u3082\u3044\u3044\u3089\u3057\u3044\u304c\u63a8\u5968\u306f\u3055\u308c\u306a\u3044\u3089\u3057\u3044\uff09\u3068\u3001runif\u3067\u30d9\u30af\u30c8\u30eb\u304c\u751f\u6210\u3055\u308c\u308b\u3068\u3044\u3046\u4e8b\u3001\u30d9\u30af\u30c8\u30eb\uff08\u306e\u8981\u7d20\uff09\u540c\u58eb\u306e\u6f14\u7b97\u3092\u7c21\u5358\u306b\u66f8\u3051\u308b\u3068\u3044\u3046\u4e8b\u3092\u77e5\u308b\u3068\u3001\u7279\u306b\u96e3\u3057\u304f\u306f\u7121\u3055\u305d\u3046\u3067\u3042\u308b\u3002<br \/>\n\u307e\u3041\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306a\u306e\u3067\u305d\u3093\u306a\u306b\u96e3\u3057\u3044\u308f\u3051\u306f\u306a\u3044\u306e\u3060\u304c\u3002<\/p>\n<p>\u6b21\u306bWikipedia\u306b\u3088\u308b\u3068R\u306f\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u8a00\u8a9e\u306e\u3088\u3046\u3067\u3042\u308b\u3002<br \/>\n\u305d\u306e\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306f<a href=\"http:\/\/cran.r-project.org\/\" target=\"_blank\">The Comprehensive R Archive Network<\/a>\u3067\u914d\u5e03\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306a\u306e\u3067\u3001\u305d\u3053\u304b\u3089Mac\u7248\u306e\u73fe\u6642\u70b9\u306b\u304a\u3051\u308b\u6700\u65b0\u3068\u601d\u308f\u308c\u308bR-3.0.2.pkg\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u307f\u308b\u3002<br \/>\n\u306a\u3093\u304bGUI\u7248\u306e\u3082\u3042\u308b\u307f\u305f\u3044\u3060\u304c\u3001\u3084\u3084\u3053\u3057\u304f\u306a\u308a\u305d\u3046\u306a\u306e\u3067\u4eca\u56de\u306f\u307e\u3060\u3084\u3081\u3066\u304a\u304f\u3002<br \/>\n\uff08CUI\u7248\u3067\u3082\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306bR GUI 1.62\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u5165\u308b\u3088\u3046\u306a\u306e\u3067GUI\u7248\u3067\u306a\u304f\u3066\u3082GUI\u3092\u4f7f\u3063\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u66f8\u3051\u305d\u3046\u3067\u3042\u308b\u3002\uff09<\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u7d42\u308f\u3063\u305f\u3089\u30bf\u30fc\u30df\u30ca\u30eb.app\u3092\u7acb\u3061\u4e0a\u3052\u3066\u304a\u3082\u3080\u308d\u306b\u5927\u6587\u5b57\u3067R\u3068\u30bf\u30a4\u30d7\u3057\u3066\u30a8\u30f3\u30bf\u30fc\u3092\u62bc\u3059\u3002<br \/>\n\u305d\u3057\u305f\u3089\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u3067R\u306e\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u304c\u7acb\u3061\u4e0a\u304c\u3063\u305f\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">R version 3.0.2 (2013-09-25) -- &quot;Frisbee Sailing&quot;\r\nCopyright (C) 2013 The R Foundation for Statistical Computing\r\nPlatform: x86_64-apple-darwin10.8.0 (64-bit)\r\n\r\nR \u306f\u3001\u81ea\u7531\u306a\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3067\u3042\u308a\u3001\u300c\u5b8c\u5168\u306b\u7121\u4fdd\u8a3c\u300d\u3067\u3059\u3002 \r\n\u4e00\u5b9a\u306e\u6761\u4ef6\u306b\u5f93\u3048\u3070\u3001\u81ea\u7531\u306b\u3053\u308c\u3092\u518d\u914d\u5e03\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \r\n\u914d\u5e03\u6761\u4ef6\u306e\u8a73\u7d30\u306b\u95a2\u3057\u3066\u306f\u3001'license()' \u3042\u308b\u3044\u306f 'licence()' \u3068\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \r\n\r\nR \u306f\u591a\u304f\u306e\u8ca2\u732e\u8005\u306b\u3088\u308b\u5171\u540c\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u3059\u3002 \r\n\u8a73\u3057\u304f\u306f 'contributors()' \u3068\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \r\n\u307e\u305f\u3001R \u3084 R \u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u51fa\u7248\u7269\u3067\u5f15\u7528\u3059\u308b\u969b\u306e\u5f62\u5f0f\u306b\u3064\u3044\u3066\u306f \r\n'citation()' \u3068\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \r\n\r\n'demo()' \u3068\u5165\u529b\u3059\u308c\u3070\u30c7\u30e2\u3092\u307f\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \r\n'help()' \u3068\u3059\u308c\u3070\u30aa\u30f3\u30e9\u30a4\u30f3\u30d8\u30eb\u30d7\u304c\u51fa\u307e\u3059\u3002 \r\n'help.start()' \u3067 HTML \u30d6\u30e9\u30a6\u30b6\u306b\u3088\u308b\u30d8\u30eb\u30d7\u304c\u307f\u3089\u308c\u307e\u3059\u3002 \r\n'q()' \u3068\u5165\u529b\u3059\u308c\u3070 R \u3092\u7d42\u4e86\u3057\u307e\u3059\u3002 \r\n\r\n&gt; <\/pre>\n<p>\u307e\u3055\u304b\u306e\u65e5\u672c\u8a9e\u3067\u3042\u308b\u3002<br \/>\n\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u306b\u3082\u304d\u3061\u3093\u3068\u5bfe\u5fdc\u3057\u3066\u305d\u3046\u306a\u4e88\u611f\u304c\u3059\u308b\u3002<\/p>\n<p>\u4e0a\u8a18\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u307f\u305f\u3089\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u305f\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">&gt; s&lt;-100000\r\n&gt; x&lt;-runif(s)\r\n&gt; y&lt;-runif(s)\r\n&gt; sum(x^2+y^2&lt;=1)*4\/s\r\n&#x5B;1] 3.14468\r\n&gt; <\/pre>\n<p>\u304d\u3061\u3093\u3068\u52d5\u3044\u3066\u308b\u3088\u3046\u3060\u3002<\/p>\n<p>\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u3092\u7d42\u4e86\u3055\u305b\u308b\u305f\u3081\u306bq()\u3068\u30bf\u30a4\u30d7\u3057\u305f\u3089workspace image\u306a\u308b\u3082\u306e\u3092\u4fdd\u5b58\u3059\u308b\u304b\u8a0a\u304b\u308c\u305f\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">&gt; q()\r\nSave workspace image? &#x5B;y\/n\/c]: n<\/pre>\n<p>\u3088\u304f\u5206\u304b\u3089\u306a\u3044\u306e\u3067\u4eca\u56de\u306f\u3068\u308a\u3042\u3048\u305an\u306b\u3057\u3068\u3044\u305f\u3002<br \/>\nPython\u306e\u5bfe\u8a71\u30e2\u30fc\u30c9\u306b\u4f3c\u3066\u308b\u304cR\u306e\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u306f\u591a\u5c11\u958b\u767a\u74b0\u5883\u7684\u306a\u6a5f\u80fd\u3082\u6301\u3063\u3066\u308b\u3088\u3046\u3067\u3042\u308b\u3002<br \/>\n\u307e\u305f\u3001q()\u3068\u30bf\u30a4\u30d7\u3059\u308b\u4ee3\u308f\u308a\u306bCtrl+D\u3067\u3082\u7d42\u4e86\u51fa\u6765\u305f\u3002<\/p>\n<p>\u3068\u308a\u3042\u3048\u305a\u4eca\u56de\u306f\u3053\u3053\u307e\u3067\u3002<br \/>\n\u4eca\u306e\u3068\u3053\u308d\u7279\u306b\u7570\u8cea\u306a\u611f\u3058\u306f\u305d\u3093\u306a\u306b\u3057\u306a\u3044\u306e\u3067\u3061\u3087\u3063\u3068\u5b89\u5fc3\u3057\u305f\u3002<br \/>\n\u3082\u3046\u5c11\u3057\u8907\u96d1\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u72ec\u81ea\u306b\u8003\u3048\u3066\u66f8\u3044\u3066\u307f\u308b\u3068\u300cR\u8a00\u8a9e\u5206\u304b\u3063\u305f\u300d\u3068\u601d\u3048\u308b\u3088\u3046\u306b\u306a\u308b\u3060\u308d\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Twitter\u3067R\u8a00\u8a9e\u306b\u3064\u3044\u3066\u306e\u8a71\u984c\u304c\u6d41\u308c\u3066\u3044\u305f\u306e\u3092\u898b\u304b\u3051\u3066\u306a\u3093\u3068\u306a\u304f\u3084\u3063\u3066\u307f\u3088\u3046\u304b\u3068\u601d\u3063\u305f\u3002<\/p>\n<p>R\u8a00\u8a9e\u3068\u3044\u3046\u3068\u4f55\u5e74\u3082\u524d\u304b\u3089\u540d\u524d\u3060\u3051\u306f\u77e5\u3063\u3066\u308b\u3051\u3069\u3001\u30d9\u30af\u30c8\u30eb\u51e6\u7406\u306b\u7279\u5316\u3057\u305f\u8a00\u8a9e\u3068\u3044\u3046\u4ee5\u5916\u306f\u4f55\u3082\u77e5\u3089\u306a\u3044\u3002<br \/>\n\u305d\u308c\u3053\u305d\u30b3\u30f3\u30d1\u30a4\u30e9\u65b9\u5f0f\u306a\u306e\u304b\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u65b9\u5f0f\u306a\u306e\u304b\u3001\u305d\u306e\u8fba\u308a\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u540d\uff08\u30b3\u30de\u30f3\u30c9\u540d\uff09\u306f\u4f55\u306a\u306e\u304b\u3055\u3048\u77e5\u3089\u306a\u3044\u3002<\/p>\n<p>\u3067\u3082\u30d9\u30af\u30c8\u30eb\u51e6\u7406\u306b\u7279\u5316\u3057\u305f\u8a00\u8a9e\u306a\u3089\u5f53\u7136\u30d9\u30af\u30c8\u30eb\u51e6\u7406\u304c\u7c21\u5358\u306b\u66f8\u3051\u308b\u3093\u3060\u308d\u3046\u3057\u3001CPU\u3084GPU\u7b49\u306e\u30d7\u30ed\u30bb\u30c3\u30b5\u3082\u4eca\u307e\u3067\u4ee5\u4e0a\u306b\u3055\u3089\u306b\u30b3\u30a2\u6570\u304c\u5897\u3048\u3066\u3044\u304f\u65b9\u5411\u3067\u6027\u80fd\u304c\u5f37\u5316\u3055\u308c\u3066\u3044\u304f\u3067\u3042\u308d\u3046\u4e8b\u3092\u8003\u3048\u308b\u3068\u3001\u4f55\u304b\u5c06\u6765\u6027\u304c\u3042\u308a\u305d\u3046\u306a\u6c17\u304c\u3059\u308b\u3002<br \/>\n\u305d\u308c\u306b\u3001\u624b\u7d9a\u304d\u578b\u8a00\u8a9e\u306e\u8a2d\u8a08\u306b\u95a2\u6570\u578b\u8a00\u8a9e\u3092\u5229\u7528\u3059\u308b\u304c\u5982\u304f\u3001\u6700\u7d42\u7684\u306bC++\u3084CUDA\u3067\u30d9\u30af\u30c8\u30eb\u51e6\u7406\u3092\u884c\u3046\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304f\u306b\u3057\u308d\u3001\u4e8b\u524d\u306bR\u8a00\u8a9e\u3067\u8a2d\u8a08\u7684\u306a\u4e8b\u304c\u3067\u304d\u305f\u3089\u8272\u3005\u3088\u308d\u3057\u3044\u306e\u3067\u306f\u306a\u3044\u304b\u3068\u601d\u3046\u3002<br \/>\n\u307e\u3041\u4f55\u3082\u77e5\u3089\u306a\u3044\u306e\u3067\u3053\u3046\u3044\u3046\u7528\u9014\u306b\u4f7f\u3048\u308b\u304b\u306f\u5168\u304f\u5206\u304b\u3089\u306a\u3044\u3051\u3069\u3002<\/p>\n<p>\u3053\u3046\u3044\u3046\u5168\u304f\u77e5\u3089\u306a\u3044\u3082\u306e\u306b\u95a2\u3057\u3066\u8abf\u3079\u59cb\u3081\u308b\u306b\u306fWikipedia\u306f\u5f79\u306b\u7acb\u3064\u3002<br \/>\n\u3068\u3044\u3046\u3053\u3068\u3067\u3068\u308a\u3042\u3048\u305aR\u8a00\u8a9e\u306e\u30da\u30fc\u30b8\u306b\u3064\u3044\u3066\u898b\u3066\u307f\u308b\u3002<br \/>\n<a href=\"http:\/\/ja.wikipedia.org\/wiki\/R%E8%A8%80%E8%AA%9E\" target=\"_blank\">R\u8a00\u8a9e &#8211; Wikipedia<\/a><\/p>\n<p>\u3060\u3044\u3076\u5145\u5b9f\u3057\u3066\u308b\u611f\u306f\u3042\u308b\u304c\u3001\u4eca\u56de\u306f\u624b\u5143\u306eMac\u3067R\u8a00\u8a9e\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u3068\u308a\u3042\u3048\u305a\u5b9f\u884c\u51fa\u6765\u308b\u3068\u3053\u308d\u307e\u3067\u884c\u3051\u308c\u3070\u3044\u3044\u306a\u3068\u601d\u3063\u3066\u308b\u306e\u3067\u3001\u305d\u308c\u306b\u5fc5\u8981\u305d\u3046\u306a\u3068\u3053\u308d\u3060\u3051\u898b\u3066\u307f\u308b\u3002<\/p>\n<p>\u307e\u305a\u306f\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3002<br \/>\n\u4e0a\u8a18\u306e\u30da\u30fc\u30b8\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5186\u5468\u7387\u3092\u30e2\u30f3\u30c6\u30ab\u30eb\u30ed\u6cd5\u3067\u8fd1\u4f3c\u3059\u308b\u8a08\u7b97\u306e\u4f8b\u304c\u8f09\u3063\u3066\u3044\u308b\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">s&lt;-100000\r\nx&lt;-runif(s)\r\ny&lt;-runif(s)\r\nsum(x^2+y^2&lt;=1)*4\/s<\/pre>\n<p>\u4ee3\u5165\u3092&lt;-\u3068\u66f8\u304f\u3068\u3053\u308d\uff08=\u3067\u3082\u3044\u3044\u3089\u3057\u3044\u304c\u63a8\u5968\u306f\u3055\u308c\u306a\u3044\u3089\u3057\u3044\uff09\u3068\u3001runif\u3067\u30d9\u30af\u30c8\u30eb\u304c\u751f\u6210\u3055\u308c\u308b\u3068\u3044\u3046\u4e8b\u3001\u30d9\u30af\u30c8\u30eb\uff08\u306e\u8981\u7d20\uff09\u540c\u58eb\u306e\u6f14\u7b97\u3092\u7c21\u5358\u306b\u66f8\u3051\u308b\u3068\u3044\u3046\u4e8b\u3092\u77e5\u308b\u3068\u3001\u7279\u306b\u96e3\u3057\u304f\u306f\u7121\u3055\u305d\u3046\u3067\u3042\u308b\u3002<br \/>\n\u307e\u3041\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306a\u306e\u3067\u305d\u3093\u306a\u306b\u96e3\u3057\u3044\u308f\u3051\u306f\u306a\u3044\u306e\u3060\u304c\u3002<\/p>\n<p>\u6b21\u306bWikipedia\u306b\u3088\u308b\u3068R\u306f\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u8a00\u8a9e\u306e\u3088\u3046\u3067\u3042\u308b\u3002<br \/>\n\u305d\u306e\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306f<a href=\"http:\/\/cran.r-project.org\/\" target=\"_blank\">The Comprehensive R Archive Network<\/a>\u3067\u914d\u5e03\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306a\u306e\u3067\u3001\u305d\u3053\u304b\u3089Mac\u7248\u306e\u73fe\u6642\u70b9\u306b\u304a\u3051\u308b\u6700\u65b0\u3068\u601d\u308f\u308c\u308bR-3.0.2.pkg\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u307f\u308b\u3002<br \/>\n\u306a\u3093\u304bGUI\u7248\u306e\u3082\u3042\u308b\u307f\u305f\u3044\u3060\u304c\u3001\u3084\u3084\u3053\u3057\u304f\u306a\u308a\u305d\u3046\u306a\u306e\u3067\u4eca\u56de\u306f\u307e\u3060\u3084\u3081\u3066\u304a\u304f\u3002<br \/>\n\uff08CUI\u7248\u3067\u3082\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6642\u306bR GUI 1.62\u304c\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u5165\u308b\u3088\u3046\u306a\u306e\u3067GUI\u7248\u3067\u306a\u304f\u3066\u3082GUI\u3092\u4f7f\u3063\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u306f\u66f8\u3051\u305d\u3046\u3067\u3042\u308b\u3002\uff09<\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u7d42\u308f\u3063\u305f\u3089\u30bf\u30fc\u30df\u30ca\u30eb.app\u3092\u7acb\u3061\u4e0a\u3052\u3066\u304a\u3082\u3080\u308d\u306b\u5927\u6587\u5b57\u3067R\u3068\u30bf\u30a4\u30d7\u3057\u3066\u30a8\u30f3\u30bf\u30fc\u3092\u62bc\u3059\u3002<br \/>\n\u305d\u3057\u305f\u3089\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u611f\u3058\u3067R\u306e\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u304c\u7acb\u3061\u4e0a\u304c\u3063\u305f\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">R version 3.0.2 (2013-09-25) -- &quot;Frisbee Sailing&quot;\r\nCopyright (C) 2013 The R Foundation for Statistical Computing\r\nPlatform: x86_64-apple-darwin10.8.0 (64-bit)\r\n\r\nR \u306f\u3001\u81ea\u7531\u306a\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3067\u3042\u308a\u3001\u300c\u5b8c\u5168\u306b\u7121\u4fdd\u8a3c\u300d\u3067\u3059\u3002 \r\n\u4e00\u5b9a\u306e\u6761\u4ef6\u306b\u5f93\u3048\u3070\u3001\u81ea\u7531\u306b\u3053\u308c\u3092\u518d\u914d\u5e03\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \r\n\u914d\u5e03\u6761\u4ef6\u306e\u8a73\u7d30\u306b\u95a2\u3057\u3066\u306f\u3001'license()' \u3042\u308b\u3044\u306f 'licence()' \u3068\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \r\n\r\nR \u306f\u591a\u304f\u306e\u8ca2\u732e\u8005\u306b\u3088\u308b\u5171\u540c\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u3059\u3002 \r\n\u8a73\u3057\u304f\u306f 'contributors()' \u3068\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \r\n\u307e\u305f\u3001R \u3084 R \u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u51fa\u7248\u7269\u3067\u5f15\u7528\u3059\u308b\u969b\u306e\u5f62\u5f0f\u306b\u3064\u3044\u3066\u306f \r\n'citation()' \u3068\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 \r\n\r\n'demo()' \u3068\u5165\u529b\u3059\u308c\u3070\u30c7\u30e2\u3092\u307f\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 \r\n'help()' \u3068\u3059\u308c\u3070\u30aa\u30f3\u30e9\u30a4\u30f3\u30d8\u30eb\u30d7\u304c\u51fa\u307e\u3059\u3002 \r\n'help.start()' \u3067 HTML \u30d6\u30e9\u30a6\u30b6\u306b\u3088\u308b\u30d8\u30eb\u30d7\u304c\u307f\u3089\u308c\u307e\u3059\u3002 \r\n'q()' \u3068\u5165\u529b\u3059\u308c\u3070 R \u3092\u7d42\u4e86\u3057\u307e\u3059\u3002 \r\n\r\n&gt; <\/pre>\n<p>\u307e\u3055\u304b\u306e\u65e5\u672c\u8a9e\u3067\u3042\u308b\u3002<br \/>\n\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u6587\u5b57\u306b\u3082\u304d\u3061\u3093\u3068\u5bfe\u5fdc\u3057\u3066\u305d\u3046\u306a\u4e88\u611f\u304c\u3059\u308b\u3002<\/p>\n<p>\u4e0a\u8a18\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u307f\u305f\u3089\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u305f\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">&gt; s&lt;-100000\r\n&gt; x&lt;-runif(s)\r\n&gt; y&lt;-runif(s)\r\n&gt; sum(x^2+y^2&lt;=1)*4\/s\r\n&#x5B;1] 3.14468\r\n&gt; <\/pre>\n<p>\u304d\u3061\u3093\u3068\u52d5\u3044\u3066\u308b\u3088\u3046\u3060\u3002<\/p>\n<p>\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u3092\u7d42\u4e86\u3055\u305b\u308b\u305f\u3081\u306bq()\u3068\u30bf\u30a4\u30d7\u3057\u305f\u3089workspace image\u306a\u308b\u3082\u306e\u3092\u4fdd\u5b58\u3059\u308b\u304b\u8a0a\u304b\u308c\u305f\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">&gt; q()\r\nSave workspace image? &#x5B;y\/n\/c]: n<\/pre>\n<p>\u3088\u304f\u5206\u304b\u3089\u306a\u3044\u306e\u3067\u4eca\u56de\u306f\u3068\u308a\u3042\u3048\u305an\u306b\u3057\u3068\u3044\u305f\u3002<br \/>\nPython\u306e\u5bfe\u8a71\u30e2\u30fc\u30c9\u306b\u4f3c\u3066\u308b\u304cR\u306e\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u306f\u591a\u5c11\u958b\u767a\u74b0\u5883\u7684\u306a\u6a5f\u80fd\u3082\u6301\u3063\u3066\u308b\u3088\u3046\u3067\u3042\u308b\u3002<br \/>\n\u307e\u305f\u3001q()\u3068\u30bf\u30a4\u30d7\u3059\u308b\u4ee3\u308f\u308a\u306bCtrl+D\u3067\u3082\u7d42\u4e86\u51fa\u6765\u305f\u3002<\/p>\n<p>\u3068\u308a\u3042\u3048\u305a\u4eca\u56de\u306f\u3053\u3053\u307e\u3067\u3002<br \/>\n\u4eca\u306e\u3068\u3053\u308d\u7279\u306b\u7570\u8cea\u306a\u611f\u3058\u306f\u305d\u3093\u306a\u306b\u3057\u306a\u3044\u306e\u3067\u3061\u3087\u3063\u3068\u5b89\u5fc3\u3057\u305f\u3002<br \/>\n\u3082\u3046\u5c11\u3057\u8907\u96d1\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u72ec\u81ea\u306b\u8003\u3048\u3066\u66f8\u3044\u3066\u307f\u308b\u3068\u300cR\u8a00\u8a9e\u5206\u304b\u3063\u305f\u300d\u3068\u601d\u3048\u308b\u3088\u3046\u306b\u306a\u308b\u3060\u308d\u3046\u3002<\/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":[470],"class_list":["post-3157","post","type-post","status-publish","format-standard","hentry","category-tech","tag-r"],"_links":{"self":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/posts\/3157","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/comments?post=3157"}],"version-history":[{"count":0,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/posts\/3157\/revisions"}],"wp:attachment":[{"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/media?parent=3157"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/categories?post=3157"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/peta.okechan.net\/blog\/wp-json\/wp\/v2\/tags?post=3157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}