Skip to content
Prev 212195 / 398500 Next

two questions for R beginners

John Sorkin wrote:
I think you've misunderstood the argument.  It would not be hard to make 
the suggested change.  I don't object to it because it would be too much 
work, I object to it because I think it is not an improvement.  
Dataframes and matrices are different, and there is no way to avoid that 
fact. 

The arguments in favour of the change seem to be these:

 - Dataframes and matrices are similar in some respects, so they should 
be similar in more.

In fact, I believe that the source of confusion is the fact that  the 
are similar, so this would not improve things.  People would still be 
confused by the differences, which are unavoidable.

 - Using $ to extract a column of a matrix would be convenient.

I agree, it saves 4 keystrokes to type X$column instead of 
X[,"column"].  But I think it increases confusion, so the savings are 
not worthwhile.  For example, the col2rgb function returns a matrix with 
rows named red, green and blue.  But under your proposal, I'd still need 
to use X["red",] to extract the red component, because columns are 
components, but rows are not.   You are complaining that the lack of $ 
for matrices is an unnecessary asymmetry, and unnecessary asymmetries 
are confusing.  But your proposal introduces a new one!
 
  - Some functions return matrices when I expect a dataframe, or vice versa.

That will continue to be true regardless of whether the proposed change 
is made.  You need to read the documentation.  If it is unclear, it 
should be improved, the language shouldn't be changed so that sloppy 
documentation is accurate.

  - You suggested this so anyone who disagrees must be lazy.

Which really is an ad hominem argument, despite your disclaimer.  I 
think you should respect the fact that there are people who disagree 
with the value of your suggestion.   (Which is also an ad hominem 
attack, but isn't central to my argument.)

Duncan Murdoch

Thread (40 messages)

Karl Ove Hufthammer two questions for R beginners Mar 1 Karl Ove Hufthammer two questions for R beginners Mar 1 PIKAL Petr two questions for R beginners Mar 1 Duncan Murdoch two questions for R beginners Mar 1 (Ted Harding) two questions for R beginners Mar 1 Karl Ove Hufthammer two questions for R beginners Mar 1 (Ted Harding) two questions for R beginners Mar 1 PIKAL Petr two questions for R beginners Mar 1 Duncan Murdoch two questions for R beginners Mar 1 John Sorkin two questions for R beginners Mar 1 (Ted Harding) two questions for R beginners Mar 1 Duncan Murdoch two questions for R beginners Mar 1 Karl Ove Hufthammer two questions for R beginners Mar 1 Hadley Wickham two questions for R beginners Mar 1 Gustaf Rydevik two questions for R beginners Mar 1 Karl Ove Hufthammer two questions for R beginners Mar 1 Karl Ove Hufthammer two questions for R beginners Mar 1 Patrick Burns two questions for R beginners Mar 1 Hadley Wickham two questions for R beginners Mar 1 Albert-Jan Roskam two questions for R beginners Mar 1 Duncan Murdoch two questions for R beginners Mar 1 Peter Alspach two questions for R beginners Mar 1 Jim Lemon two questions for R beginners Mar 1 (Ted Harding) two questions for R beginners Mar 1 Karl Ove Hufthammer two questions for R beginners Mar 2 Karl Ove Hufthammer two questions for R beginners Mar 2 John Sorkin two questions for R beginners Mar 2 Duncan Murdoch two questions for R beginners Mar 2 Gabor Grothendieck two questions for R beginners Mar 2 William Dunlap two questions for R beginners Mar 2 Duncan Murdoch two questions for R beginners Mar 2 Patrick Burns two questions for R beginners Mar 3 PIKAL Petr two questions for R beginners Mar 3 John Sorkin two questions for R beginners Mar 3 PIKAL Petr two questions for R beginners Mar 3 William Dunlap two questions for R beginners Mar 3 John Sorkin two questions for R beginners Mar 3 David Winsemius two questions for R beginners Mar 3 Jim Lemon two questions for R beginners Mar 3 kMan two questions for R beginners Mar 3