Skip to content
Prev 175973 / 398503 Next

new line between '}' and 'else' in function body

Thanks, Romain! So I think, for consistency, the following result
+ f = function(x) {
+    if (x) {
+        1
+    } # a new line here!
+    else {
+        2
+    }
+ }
+ ')
+ )
[1] "structure(expression(f = function(x) {" "    if (x) {"
[3] "        1"                              "    }"
[5] "    else {"                             "        2"
[7] "    }"                                  "}), srcfile =
<environment>)"

should be

[1] "structure(expression(f = function(x) {" "    if (x) {"
[3] "        1"                              "    } else {"
[5] "        2"                             "    }"
[7] "}), srcfile = <environment>)"

instead.

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Phone: +86-(0)10-82509086 Fax: +86-(0)10-82509086
Mobile: +86-15810805877
Homepage: http://www.yihui.name
School of Statistics, Room 1037, Mingde Main Building,
Renmin University of China, Beijing, 100872, China



On Fri, Apr 3, 2009 at 2:48 PM, Romain Francois
<romain.francois at dbmail.com> wrote: