<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: R Design Flaws #1 and #2:  A Solution to Both?</title>
	<atom:link href="http://radfordneal.wordpress.com/2008/08/25/r-design-flaws-1-and-2-a-solution-to-both/feed/" rel="self" type="application/rss+xml" />
	<link>http://radfordneal.wordpress.com/2008/08/25/r-design-flaws-1-and-2-a-solution-to-both/</link>
	<description></description>
	<lastBuildDate>Sat, 03 Oct 2009 22:21:37 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Sandro Saitta</title>
		<link>http://radfordneal.wordpress.com/2008/08/25/r-design-flaws-1-and-2-a-solution-to-both/#comment-151</link>
		<dc:creator>Sandro Saitta</dc:creator>
		<pubDate>Thu, 18 Sep 2008 07:02:56 +0000</pubDate>
		<guid isPermaLink="false">http://radfordneal.wordpress.com/?p=351#comment-151</guid>
		<description>Alex: I use Snow and PVM for parallelizing data mining tasks and it works fine (at least on Linux).</description>
		<content:encoded><![CDATA[<p>Alex: I use Snow and PVM for parallelizing data mining tasks and it works fine (at least on Linux).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://radfordneal.wordpress.com/2008/08/25/r-design-flaws-1-and-2-a-solution-to-both/#comment-104</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Mon, 08 Sep 2008 04:57:31 +0000</pubDate>
		<guid isPermaLink="false">http://radfordneal.wordpress.com/?p=351#comment-104</guid>
		<description>wcw: I had not encounted the snow package previously. Thanks to you and Radford for the reference.</description>
		<content:encoded><![CDATA[<p>wcw: I had not encounted the snow package previously. Thanks to you and Radford for the reference.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Corey</title>
		<link>http://radfordneal.wordpress.com/2008/08/25/r-design-flaws-1-and-2-a-solution-to-both/#comment-90</link>
		<dc:creator>Corey</dc:creator>
		<pubDate>Wed, 03 Sep 2008 22:19:02 +0000</pubDate>
		<guid isPermaLink="false">http://radfordneal.wordpress.com/?p=351#comment-90</guid>
		<description>wcw,

In MATLAB, 2-D arrays are atomic, so there&#039;s no distinction between scalars, vectors, and matrices.  (N-dimensional arrays for N&gt;2 get a little special, but they&#039;re not too bad.)  There&#039;s no wackiness when pulling a row vector or column vector out of a matrix, as both the operand and the output are atomic data types. Also, MATLAB&#039;s binary &quot;:&quot; operator only generates increasing sequences, so if n&gt;m, n:m is empty (MATLAB&#039;s version of NULL). (There&#039;s also a trinary n:k:m operator, where k is an arbitrary increment.)</description>
		<content:encoded><![CDATA[<p>wcw,</p>
<p>In MATLAB, 2-D arrays are atomic, so there&#8217;s no distinction between scalars, vectors, and matrices.  (N-dimensional arrays for N&gt;2 get a little special, but they&#8217;re not too bad.)  There&#8217;s no wackiness when pulling a row vector or column vector out of a matrix, as both the operand and the output are atomic data types. Also, MATLAB&#8217;s binary &#8220;:&#8221; operator only generates increasing sequences, so if n&gt;m, n:m is empty (MATLAB&#8217;s version of NULL). (There&#8217;s also a trinary n:k:m operator, where k is an arbitrary increment.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fixing some problems in R &#171; Hans Gilde&#8217;s weblog</title>
		<link>http://radfordneal.wordpress.com/2008/08/25/r-design-flaws-1-and-2-a-solution-to-both/#comment-89</link>
		<dc:creator>Fixing some problems in R &#171; Hans Gilde&#8217;s weblog</dc:creator>
		<pubDate>Wed, 03 Sep 2008 17:45:12 +0000</pubDate>
		<guid isPermaLink="false">http://radfordneal.wordpress.com/?p=351#comment-89</guid>
		<description>[...] 3, 2008   Radford Neal points out a few problems in R in this post on his [...]</description>
		<content:encoded><![CDATA[<p>[...] 3, 2008   Radford Neal points out a few problems in R in this post on his [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Radford Neal</title>
		<link>http://radfordneal.wordpress.com/2008/08/25/r-design-flaws-1-and-2-a-solution-to-both/#comment-88</link>
		<dc:creator>Radford Neal</dc:creator>
		<pubDate>Wed, 03 Sep 2008 05:22:43 +0000</pubDate>
		<guid isPermaLink="false">http://radfordneal.wordpress.com/?p=351#comment-88</guid>
		<description>I&#039;d never heard of snow, and probably many other readers haven&#039;t as well.  It appears to be &lt;a href=&quot;http://cran.r-project.org/web/packages/snow/snow.pdf&quot; rel=&quot;nofollow&quot;&gt;this package&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>I&#8217;d never heard of snow, and probably many other readers haven&#8217;t as well.  It appears to be <a href="http://cran.r-project.org/web/packages/snow/snow.pdf" rel="nofollow">this package</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wcw</title>
		<link>http://radfordneal.wordpress.com/2008/08/25/r-design-flaws-1-and-2-a-solution-to-both/#comment-87</link>
		<dc:creator>wcw</dc:creator>
		<pubDate>Wed, 03 Sep 2008 05:08:40 +0000</pubDate>
		<guid isPermaLink="false">http://radfordneal.wordpress.com/?p=351#comment-87</guid>
		<description>..er, what?

&gt; library(snow)

Yes, you have to parallelize by hand, and for someone who like me is really only competent to do that to embarrassingly parallel problems, that may not be the solution.  Still, clusterSplit() your lists and go to town on them.

I don&#039;t know Matlab that well.  What would it do?</description>
		<content:encoded><![CDATA[<p>..er, what?</p>
<p>&gt; library(snow)</p>
<p>Yes, you have to parallelize by hand, and for someone who like me is really only competent to do that to embarrassingly parallel problems, that may not be the solution.  Still, clusterSplit() your lists and go to town on them.</p>
<p>I don&#8217;t know Matlab that well.  What would it do?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://radfordneal.wordpress.com/2008/08/25/r-design-flaws-1-and-2-a-solution-to-both/#comment-84</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Fri, 29 Aug 2008 18:58:57 +0000</pubDate>
		<guid isPermaLink="false">http://radfordneal.wordpress.com/?p=351#comment-84</guid>
		<description>This concept reminds me of the xrange type in Python (&lt;a href=&quot;http://docs.python.org/lib/built-in-funcs.html&quot; rel=&quot;nofollow&quot;&gt;Python library ref page&lt;/a&gt;), which can be quite useful for this type of application.

In my experience, the reversible sequences can be a bit of a nuisance, but dropped dimensions (and the general issue of numeric vectors and single column matrices being treated differently) tend to come up far more frequently. It&#039;s one of the few standards I miss from Matlab (along with parallelization; I would kill for parallel implementations of apply &amp; lapply).</description>
		<content:encoded><![CDATA[<p>This concept reminds me of the xrange type in Python (<a href="http://docs.python.org/lib/built-in-funcs.html" rel="nofollow">Python library ref page</a>), which can be quite useful for this type of application.</p>
<p>In my experience, the reversible sequences can be a bit of a nuisance, but dropped dimensions (and the general issue of numeric vectors and single column matrices being treated differently) tend to come up far more frequently. It&#8217;s one of the few standards I miss from Matlab (along with parallelization; I would kill for parallel implementations of apply &amp; lapply).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Radford Neal</title>
		<link>http://radfordneal.wordpress.com/2008/08/25/r-design-flaws-1-and-2-a-solution-to-both/#comment-83</link>
		<dc:creator>Radford Neal</dc:creator>
		<pubDate>Thu, 28 Aug 2008 16:42:02 +0000</pubDate>
		<guid isPermaLink="false">http://radfordneal.wordpress.com/?p=351#comment-83</guid>
		<description>Certainly one would need to retain backward compatibility, so for loops would still work with &quot;in&quot; referring to vectors or lists, as well as indexing pairs.  If we weren&#039;t worried about backward compatibility, we could just redefine 1:n, rather than introducing the 1..n notation.  And of course iterating over vectors or lists that aren&#039;t sequences can be useful.  The problem doesn&#039;t arise because for loops can do that, but rather because 1:n doesn&#039;t work as desired.

I don&#039;t see any need to propagate indexing pairs into other contexts.  The problem of reversing sequences doesn&#039;t really arise with plot(log(1..n)), for instance, since when n is zero this doesn&#039;t make sense anyway (unlike for loops, where zero iterations usually does make sense).  Also, I&#039;d envision i..j only being allowed when i and j are integers.  I would envision indexing pairs as not being allowable operands for arithmetic and other operators, other than there being some sort of way of extracting the low and high bounds from an indexing pair.</description>
		<content:encoded><![CDATA[<p>Certainly one would need to retain backward compatibility, so for loops would still work with &#8220;in&#8221; referring to vectors or lists, as well as indexing pairs.  If we weren&#8217;t worried about backward compatibility, we could just redefine 1:n, rather than introducing the 1..n notation.  And of course iterating over vectors or lists that aren&#8217;t sequences can be useful.  The problem doesn&#8217;t arise because for loops can do that, but rather because 1:n doesn&#8217;t work as desired.</p>
<p>I don&#8217;t see any need to propagate indexing pairs into other contexts.  The problem of reversing sequences doesn&#8217;t really arise with plot(log(1..n)), for instance, since when n is zero this doesn&#8217;t make sense anyway (unlike for loops, where zero iterations usually does make sense).  Also, I&#8217;d envision i..j only being allowed when i and j are integers.  I would envision indexing pairs as not being allowable operands for arithmetic and other operators, other than there being some sort of way of extracting the low and high bounds from an indexing pair.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cyril</title>
		<link>http://radfordneal.wordpress.com/2008/08/25/r-design-flaws-1-and-2-a-solution-to-both/#comment-82</link>
		<dc:creator>Cyril</dc:creator>
		<pubDate>Thu, 28 Aug 2008 15:46:47 +0000</pubDate>
		<guid isPermaLink="false">http://radfordneal.wordpress.com/?p=351#comment-82</guid>
		<description>One comment about this proposal is that the current syntax, despite its flaws, provides a unification of the sequence and list notations, which is very convenient in some situations.

This is useful for extracting non-sequential rows/columns as mentioned above, but also in loops, eg one can use

for(l in c(&quot;low&quot;,&quot;med&quot;,&quot;high&quot;)) ...

Using indexing pairs would require (if I understand correctly) two different implementation of for, which would have to be kept coherent so that, presumable, for (i in 1..n) would behave exactly like for (i in 1:n) when n&gt;=1, apart from the memory usage.

Also, would you envision indexing pairs to default as sequences in cases like plot(log(1..20)), or (1..100)/100 ?</description>
		<content:encoded><![CDATA[<p>One comment about this proposal is that the current syntax, despite its flaws, provides a unification of the sequence and list notations, which is very convenient in some situations.</p>
<p>This is useful for extracting non-sequential rows/columns as mentioned above, but also in loops, eg one can use</p>
<p>for(l in c(&#8220;low&#8221;,&#8221;med&#8221;,&#8221;high&#8221;)) &#8230;</p>
<p>Using indexing pairs would require (if I understand correctly) two different implementation of for, which would have to be kept coherent so that, presumable, for (i in 1..n) would behave exactly like for (i in 1:n) when n&gt;=1, apart from the memory usage.</p>
<p>Also, would you envision indexing pairs to default as sequences in cases like plot(log(1..20)), or (1..100)/100 ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Radford Neal</title>
		<link>http://radfordneal.wordpress.com/2008/08/25/r-design-flaws-1-and-2-a-solution-to-both/#comment-80</link>
		<dc:creator>Radford Neal</dc:creator>
		<pubDate>Wed, 27 Aug 2008 18:00:14 +0000</pubDate>
		<guid isPermaLink="false">http://radfordneal.wordpress.com/?p=351#comment-80</guid>
		<description>Hans,

I don&#039;t see that there would be problems of the sort you talk about.  The documentation would present M[1..n,] (or M[1:&gt;:n,] if that&#039;s the syntax) as the normal way to get a matrix consisting of the first n rows of M.  It might mention that M[1:n,] looks similar, but doesn&#039;t work when n is zero or one. I don&#039;t see how this produces anything but improvement.  (Of course, there ideally wouldn&#039;t be these two similar-looking things, but we don&#039;t have the option of redesigning R from scratch without worrying about backward compatibility).

You mention a function that takes a vector of numbers as an argument and uses it as a subscript, and worry about someone calling it with an indexing pair like 1..n instead of a vector.  But I don&#039;t see the problem.  The indexing pair should work just like 1:n, except that it does the right thing when n is zero or one.  The only exception would be if the function actually &lt;b&gt;wants&lt;/b&gt; the inconsistent behaviour of the dimension being dropped when n is one, but not otherwise.  This is not usually the case (and hence the function will be using drop=FALSE, if it doesn&#039;t have a bug).  And if a function does want this behaviour, it would even now be good practice to program it explicity, or at least explicityly specify drop=TRUE (which might be made to still have effect with an indexing pair - ie, the default might depend on the subscript type, analogously to lots of other defaults in R).

My previous post did suggest a new subscript notation, replacing commas with semicolons to separate subscripts (obviously the issue arises only when there is more than one subscript).  I don&#039;t understand your last sentence about indexing pairs working with this - I&#039;d see them as alternatives, not things to use together, unless one really thinks indexing by vectors that aren&#039;t sequences is common enough to justify another extension.</description>
		<content:encoded><![CDATA[<p>Hans,</p>
<p>I don&#8217;t see that there would be problems of the sort you talk about.  The documentation would present M[1..n,] (or M[1:&gt;:n,] if that&#8217;s the syntax) as the normal way to get a matrix consisting of the first n rows of M.  It might mention that M[1:n,] looks similar, but doesn&#8217;t work when n is zero or one. I don&#8217;t see how this produces anything but improvement.  (Of course, there ideally wouldn&#8217;t be these two similar-looking things, but we don&#8217;t have the option of redesigning R from scratch without worrying about backward compatibility).</p>
<p>You mention a function that takes a vector of numbers as an argument and uses it as a subscript, and worry about someone calling it with an indexing pair like 1..n instead of a vector.  But I don&#8217;t see the problem.  The indexing pair should work just like 1:n, except that it does the right thing when n is zero or one.  The only exception would be if the function actually <b>wants</b> the inconsistent behaviour of the dimension being dropped when n is one, but not otherwise.  This is not usually the case (and hence the function will be using drop=FALSE, if it doesn&#8217;t have a bug).  And if a function does want this behaviour, it would even now be good practice to program it explicity, or at least explicityly specify drop=TRUE (which might be made to still have effect with an indexing pair &#8211; ie, the default might depend on the subscript type, analogously to lots of other defaults in R).</p>
<p>My previous post did suggest a new subscript notation, replacing commas with semicolons to separate subscripts (obviously the issue arises only when there is more than one subscript).  I don&#8217;t understand your last sentence about indexing pairs working with this &#8211; I&#8217;d see them as alternatives, not things to use together, unless one really thinks indexing by vectors that aren&#8217;t sequences is common enough to justify another extension.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
