Just a small remark on "R coding style" :

>>>>> "Sean" == Sean Davis <[EMAIL PROTECTED]>
>>>>>     on Tue, 29 Nov 2005 08:34:39 -0500 writes:

      Sean> <............>

      Sean> x <- matrix(c(1,1,1,2,2,2,1,1,1,1,1,2),nr=2,byrow=TRUE)

      Sean>  <.....>
            (a very helpful answer to Georg's question; thanks, Sean!)

I've seen example code like this in many places,
and I'd like advocate a more readable alternative

   x <- rbind(c(1,1,1, 2,2,2)
              c(1,1,1, 1,1,2))

{efficiency really not being of any concern;
 we are talking about didactical examples}.

I believe  rbind() -- and indenting ("white space"
in general!) should be used much more for matrix construction --
because of quick "visual validation"
at least for small examples.

{and if you'd use ESS (http://ESS.r-project.org/), 
 a simple <Tab> key press automatically indents the 2nd line correctly!}

Martin Maechler, ETH Zurich

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to