{"id":1802,"date":"2019-06-06T15:32:40","date_gmt":"2019-06-06T06:32:40","guid":{"rendered":"http:\/\/141.164.34.82\/?p=1802"},"modified":"2019-06-06T15:36:53","modified_gmt":"2019-06-06T06:36:53","slug":"%ed%95%a0%eb%8b%b9","status":"publish","type":"post","link":"http:\/\/ds.sumeun.org\/?p=1802","title":{"rendered":"\ud560\ub2f9"},"content":{"rendered":"<h2>\uac19\uc9c0\ub9cc \uac19\uc9c0 \uc54a\uc740<\/h2>\n<p>R\uc5d0\ub294 \ubcc0\uc218\uc5d0 \uc5b4\ub5a4 \uac12\uc744 \ud560\ub2f9(assignment)\ud558\uae30 \uc704\ud574 <code>=<\/code>, <code>&lt;-<\/code>, <code>&lt;&lt;-<\/code>\uc744 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4. \ud2b9\ud788 <code>=<\/code>\uc640 <code>&lt;-<\/code>\ub294 \ud070 \ucc28\uc774\uac00 \uc5c6\uc5b4 \ubcf4\uc778\ub2e4. \uba87 \uac00\uc9c0\ub9cc \ube7c\uba74.<\/p>\n<ol>\n<li>\uc6b0\uc120\uc21c\uc704 : <code>&lt;-<\/code>\uac00 <code>=<\/code>\ubcf4\ub2e4 \ub192\ub2e4.<\/li>\n<li>\ud568\uc218\uc758 \ub9e4\uac1c\ubcc0\uc218 \uc124\uc815 : <code>=<\/code>\ub9cc \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4.<\/li>\n<\/ol>\n<p>\uc5ec\uae30\uc11c\ub294 \ud2b9\ud788 2\ubc88\uc9f8\ub97c \uc598\uae30\ud574\ubcf4\uc790.<\/p>\n<h2>\ud568\uc218\uc758 \ub9e4\uac1c\ubcc0\uc218 \uc124\uc815<\/h2>\n<p>\ub2e4\uc74c\uc758 \ud568\uc218 <code>f()<\/code>\uc5d0\ub294 \ub450 \uac1c\uc758 \ub9e4\uac1c \ubcc0\uc218\uac00 \uc788\ub2e4.<\/p>\n<pre><code class=\"r\">f = function(x,y) {\r\n  x-y\r\n}\r\n<\/code><\/pre>\n<p>\uc774\ub54c <code>=<\/code>\uacfc <code>&lt;-<\/code>\uac00 \uac19\ub2e4\uace0 \uc0dd\uac01\ud574\uc11c <code>f(x &lt;- 3, y &lt;- 1)<\/code>\uacfc \uac19\uc740 \ubc29\uc2dd\uc744 \uc0ac\uc6a9\ud558\uba74 \uc5c9\ub6b1\ud55c \uacb0\uacfc\uac00 \ub098\uc628\ub2e4.<\/p>\n<p><strong>\ud568\uc218\uc758 \ub9e4\uac1c \ubcc0\uc218\uc5d0 \ud560\ub2f9\ud560 \ub54c\uc5d0\ub294 <code>=<\/code>\ub9cc\uc744 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4.<\/strong><\/p>\n<pre><code class=\"r\">f(x &lt;- 3, y &lt;- 1)\r\n<\/code><\/pre>\n<pre>## [1] 2\r\n<\/pre>\n<p>\uc5b4\ucc0c\ub410\ub4e0 \uc704\uc758 \ud568\uc218\ub294 \uc6d0\ud558\ub294 \ub300\ub85c <code>x-y<\/code>\ub97c \uacb0\uacfc\uac12\uc73c\ub85c \ub0b4\ub193\uace0 \uc788\uc9c0 \uc54a\uc740\uac00? \ud558\uc9c0\ub9cc \uc2e4\uc0c1\uc740 \ub2e4\ub974\ub2e4. \ub2e4\uc74c\uc744 \uc2e4\ud589\uc2dc\ucf1c\ubcf4\uc790.<\/p>\n<pre><code class=\"r\">f(y &lt;- 1, x &lt;- 3)\r\n<\/code><\/pre>\n<pre>## [1] -2\r\n<\/pre>\n<p><code>f(y= , x= )<\/code>\uaf34\uc758 \uacbd\uc6b0\uc5d0\ub294 \ub9e4\uac1c\ubcc0\uc218 <code>y<\/code>\uc640 <code>x<\/code>\uc5d0 \uc6d0\ud558\ub294 \uac12\uc744 \ud560\ub2f9\ud55c\ub2e4. \ud558\uc9c0\ub9cc <code>f(y &lt;- , x &lt;- )<\/code>\uc758 \uacbd\uc6b0\uc5d0\ub294 \ub9e4\uac1c\ubcc0\uc218\uc774\ub984\uc73c\ub85c \ud560\ub2f9\ub418\ub294 \uac83\uc774 \uc544\ub2c8\ub77c \ud568\uc218 \uc815\uc758\uc5d0\uc11c \ub098\ud0c0\ub09c \ub9e4\uac1c\ubcc0\uc218 \uc21c\uc11c\ub300\ub85c \uac12\uc774 \ud560\ub2f9\ub41c\ub2e4. \ub2e4\uc2dc \ub9d0\ud574 \ub2e4\uc74c\uc758 \ub458\uc740 \uacb0\uacfc\uac00 \uac19\ub2e4.<\/p>\n<pre><code class=\"r\">f(y &lt;- 1, x &lt;- 3)\r\n<\/code><\/pre>\n<pre>## [1] -2\r\n<\/pre>\n<pre><code class=\"r\">f(x=(y &lt;- 1 ), y=(x &lt;- 3))\r\n<\/code><\/pre>\n<pre>## [1] -2\r\n<\/pre>\n<p><code>f(y &lt;- 1, x &lt;- 1)<\/code>\uc5d0\uc11c <code>y &lt;- 1<\/code>\uc740 \ubcc0\uc218 <code>y<\/code>\uc5d0 <code>1<\/code>\uc744 \ub300\uc785\ud55c\ub2e4. \uadf8\ub9ac\uace0 <code>y &lt;- 1<\/code>\uc758 \uacb0\uacfc\ub294 <code>1<\/code>\uc774\ub2e4. ( <code>print(y &lt;- 1)<\/code>\uc744 \ud574\ubcf4\uc790.) \uadf8\ub9ac\uace0 \uc774 <code>1<\/code>\uc774 \ud568\uc218\uc758 \uc778\uc790\ub85c \uc785\ub825\ub41c\ub2e4. \ud558\uc9c0\ub9cc \uc5b4\ub5a4 \ub9e4\uac1c\ubcc0\uc218\ub85c \ub4e4\uc5b4\uac08\uc9c0\uc5d0 \ub300\ud574 \uc815\ud574\uc8fc\uc9c0 \uc54a\uc558\uae30 \ub54c\ubb38\uc5d0 \ud568\uc218\uc758 \uc815\uc758(<code>f=function(x,y)<\/code>)\uc5d0\uc11c \ub098\uc624\ub294 \uccab \ubc88\uc9f8 \ub9e4\uac1c\ubcc0\uc218 <code>x<\/code>\uc5d0 <code>1<\/code>\uc774 \ub300\uc785\ub41c\ub2e4. \ub9c8\ucc2c\uac00\uc9c0 \uc774\uc720\ub85c <code>x &lt;- 1<\/code>\uc758 \uacb0\uacfc\uac12 <code>3<\/code>\uc740 \ub9e4\uac1c \ubcc0\uc218 <code>y<\/code>\uc5d0 \ub300\uc785\ub41c\ub2e4.<\/p>\n<p>\ucc38\uace0\ub85c, <code>&lt;-<\/code>\ub97c \uc4f8 \ub54c\uc5d0\ub294 \ubc18\ub4dc\uc2dc <code>&lt;<\/code>\uacfc <code>-<\/code>\ub97c \ubd99\uc5ec\uc57c \ud55c\ub2e4. \uc608\ub97c \ub4e4\uc5b4 <code>x &lt; -1<\/code>\uacfc <code>x &lt;- 1<\/code>\uc740 \uc804\ud600 \ub2e4\ub978 \uacb0\uacfc\ub97c \ub098\ud0c0\ub0b8\ub2e4.<\/p>\n<h2><code>&lt;&lt;-<\/code><\/h2>\n<p>\ub9c8\uc9c0\ub9c9\uc73c\ub85c <code>&lt;&lt;-<\/code>\ub294 \ud568\uc218 \uc548\uc5d0\uc11c \uc804\uc5ed \ubcc0\uc218\uc5d0 \uac12\uc744 \ub300\uc785\ud560 \uc218 \uc788\ub2e4. \ub2e4\uc74c\uc744 \ube44\uad50\ud574\ubcf4\uc790.<\/p>\n<pre><code class=\"r\">x=5\r\nf = function(a,b) {\r\n  x &lt;- a; y &lt;- b \r\n  x-y\r\n  }\r\nf(3,2)\r\n<\/code><\/pre>\n<pre>## [1] 1\r\n<\/pre>\n<pre><code class=\"r\">x\r\n<\/code><\/pre>\n<pre>## [1] 5\r\n<\/pre>\n<pre><code class=\"r\">x=5\r\nf = function(a,b) {\r\n  x &lt;&lt;- a; y &lt;&lt;- b \r\n  x-y\r\n  }\r\nf(3,2)\r\n<\/code><\/pre>\n<pre>## [1] 1\r\n<\/pre>\n<pre><code class=\"r\">x\r\n<\/code><\/pre>\n<pre>## [1] 3\r\n<\/pre>\n<hr \/>\n<p>\uc5ec\uae30\uc11c\ub294 R\uc5d0\uc11c \ud560\ub2f9 \uc5f0\uc0b0\uc790\ub85c \uc4f0\uc774\ub294 <code>=<\/code>, <code>&lt;-<\/code>, <code>&lt;&lt;-<\/code>\uc758 \uc758\ubbf8\ub97c \uc54c\uc544\ubcf4\uace0 \ucc28\uc774\uc810\uc744 \uc0b4\ud3b4\ubcf4\uc558\uc2b5\ub2c8\ub2e4. \ud2b9\ud788 <strong>\ud568\uc218\uc5d0\uc11c \ub9e4\uac1c\ubcc0\uc218\ub97c \uc9c0\uc815\ud560 \ub54c\uc5d0\ub294 \uaf2d <code>=<\/code>\ub97c \uc368\uc57c \ud568\uc744 \uc8fc\uc758\ud558\uc138\uc694!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uac19\uc9c0\ub9cc \uac19\uc9c0 \uc54a\uc740 R\uc5d0\ub294 \ubcc0\uc218\uc5d0 \uc5b4\ub5a4 \uac12\uc744 \ud560\ub2f9(assignment)\ud558\uae30 \uc704\ud574 =, &lt;-, &lt;&lt;-\uc744 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4. \ud2b9\ud788 =\uc640 &lt;-\ub294 \ud070 \ucc28\uc774\uac00 \uc5c6\uc5b4 \ubcf4\uc778\ub2e4. \uba87 \uac00\uc9c0\ub9cc \ube7c\uba74. \uc6b0\uc120\uc21c\uc704 : &lt;-\uac00 =\ubcf4\ub2e4 \ub192\ub2e4. \ud568\uc218\uc758 \ub9e4\uac1c\ubcc0\uc218 \uc124\uc815 : =\ub9cc \uc0ac\uc6a9\ud560 \uc218 \uc788\ub2e4. \uc5ec\uae30\uc11c\ub294 \ud2b9\ud788 2\ubc88\uc9f8\ub97c \uc598\uae30\ud574\ubcf4\uc790. \ud568\uc218\uc758 \ub9e4\uac1c\ubcc0\uc218 \uc124\uc815 \ub2e4\uc74c\uc758 \ud568\uc218 f()\uc5d0\ub294 \ub450 \uac1c\uc758 \ub9e4\uac1c \ubcc0\uc218\uac00 \uc788\ub2e4. f = [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1804,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[28,179],"tags":[316,317,278,315,318],"jetpack_featured_media_url":"http:\/\/ds.sumeun.org\/wp-content\/uploads\/2019\/06\/assignment.png","_links":{"self":[{"href":"http:\/\/ds.sumeun.org\/index.php?rest_route=\/wp\/v2\/posts\/1802"}],"collection":[{"href":"http:\/\/ds.sumeun.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ds.sumeun.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ds.sumeun.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/ds.sumeun.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1802"}],"version-history":[{"count":3,"href":"http:\/\/ds.sumeun.org\/index.php?rest_route=\/wp\/v2\/posts\/1802\/revisions"}],"predecessor-version":[{"id":1977,"href":"http:\/\/ds.sumeun.org\/index.php?rest_route=\/wp\/v2\/posts\/1802\/revisions\/1977"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/ds.sumeun.org\/index.php?rest_route=\/wp\/v2\/media\/1804"}],"wp:attachment":[{"href":"http:\/\/ds.sumeun.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1802"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ds.sumeun.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1802"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ds.sumeun.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1802"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}