Re: [R] R as a programming language

2007-11-08 Thread Duncan Murdoch
On 11/8/2007 12:57 PM, hadley wickham wrote: My objection, at least, was that + should be *associative*. I don't think anyone would expect a + b and b+a to be the same for strings, but I do think the fact that (a+b)+c and a+(b+c) would be different (if some of a, b,c were strings) has real

Re: [R] R as a programming language

2007-11-08 Thread Barry Rowlingson
hadley wickham wrote: You're assuming an automatic cast from numbers into strings? What if a + 4 threw an error? What's wrong with commas anyway when using cat(): cat(x is ,x,' and y is ',y,'\n',sep='') x is 1 and y is 2 and there's always sprintf() for those moments when you want

Re: [R] R as a programming language

2007-11-08 Thread Duncan Murdoch
On 11/8/2007 1:26 PM, Barry Rowlingson wrote: hadley wickham wrote: You're assuming an automatic cast from numbers into strings? What if a + 4 threw an error? What's wrong with commas anyway when using cat(): cat(x is ,x,' and y is ',y,'\n',sep='') x is 1 and y is 2 Nothing

Re: [R] R as a programming language

2007-11-08 Thread Gregory Warnes
(2) More process and I/O facilities, specifically I'd like forking and something like a functionconnection which works like a textconnection but obtains input from / feeds output to a function. This would allow running an external process that receives input

Re: [R] R as a programming language

2007-11-08 Thread Gabor Grothendieck
On Nov 8, 2007 3:16 PM, Jan T. Kim [EMAIL PROTECTED] wrote: On Thu, Nov 08, 2007 at 01:35:34PM -0500, Duncan Murdoch wrote: On 11/8/2007 1:26 PM, Barry Rowlingson wrote: hadley wickham wrote: You're assuming an automatic cast from numbers into strings? What if a + 4 threw an error?

Re: [R] R as a programming language

2007-11-08 Thread Peter Dalgaard
Duncan Murdoch wrote: On 11/8/2007 11:51 AM, Thomas Lumley wrote: On Wed, 7 Nov 2007, Duncan Murdoch wrote: At first I thought you were complaining about the syntax, which I find ugly. There was a proposal last year to overload + to do concatenation of strings, so you'd type

Re: [R] R as a programming language

2007-11-08 Thread Alberto Monteiro
. As the old saying goes, you can eat the cake and have it: x - rnorm(1) cat(x is close to , sprintf(%.1lf, x), and closer to , sprintf(%.10lf, x), \n, sep = ) :-) I am using R as a generic programming language for doing jobs in Windows that I can't do using DOS batch - things like taking

Re: [R] R as a programming language

2007-11-08 Thread Duncan Murdoch
On 11/8/2007 2:44 PM, Peter Dalgaard wrote: Duncan Murdoch wrote: On 11/8/2007 11:51 AM, Thomas Lumley wrote: On Wed, 7 Nov 2007, Duncan Murdoch wrote: At first I thought you were complaining about the syntax, which I find ugly. There was a proposal last year to overload + to do

Re: [R] R as a programming language

2007-11-08 Thread Gabor Grothendieck
On Nov 8, 2007 1:26 PM, Barry Rowlingson [EMAIL PROTECTED] wrote: hadley wickham wrote: You're assuming an automatic cast from numbers into strings? What if a + 4 threw an error? What's wrong with commas anyway when using cat(): cat(x is ,x,' and y is ',y,'\n',sep='') x is 1 and y

Re: [R] R as a programming language

2007-11-08 Thread Ted Harding
On 08-Nov-07 18:39:57, Gabor Grothendieck wrote: On Nov 8, 2007 1:26 PM, Barry Rowlingson [EMAIL PROTECTED] wrote: hadley wickham wrote: You're assuming an automatic cast from numbers into strings? What if a + 4 threw an error? What's wrong with commas anyway when using cat():

Re: [R] R as a programming language

2007-11-08 Thread Jan T. Kim
On Thu, Nov 08, 2007 at 01:35:34PM -0500, Duncan Murdoch wrote: On 11/8/2007 1:26 PM, Barry Rowlingson wrote: hadley wickham wrote: You're assuming an automatic cast from numbers into strings? What if a + 4 threw an error? What's wrong with commas anyway when using cat():

Re: [R] R as a programming language

2007-11-07 Thread Alexy Khrabrov
On Nov 7, 2007, at 4:13 PM, Duncan Murdoch wrote: And, still no option processing as in GNU long options, or python or ruby's optparse. What's the semantics of parameter passing -- by value or by reference? By value. Thanks Duncan! So if I have a huge table t, and the idea was to

[R] R as a programming language

2007-11-07 Thread Alexy Khrabrov
Greetings -- coming from Python/Ruby perspective, I'm wondering about certain features of R as a programming language. Say I have a huge table t of the form run ord unitwords new 1 1 69391013641 1 2 275 1001518 1 3 33141008

Re: [R] R as a programming language

2007-11-07 Thread Duncan Murdoch
On 11/7/2007 7:46 AM, Alexy Khrabrov wrote: Greetings -- coming from Python/Ruby perspective, I'm wondering about certain features of R as a programming language. Lots of question, I'll intersperse some answers. Say I have a huge table t of the form run ord unitwords new

Re: [R] R as a programming language

2007-11-07 Thread Alexy Khrabrov
With all due respect to the great book -- of which I own 2 copies I bought new -- it's not an O'Reilly Programming in X book. The idea of a programming book like that is to thoroughly treat the language from a programmer's standpoint, in a fairly standard way, such as Ruby or Python. As

Re: [R] R as a programming language

2007-11-07 Thread Duncan Murdoch
On 11/7/2007 8:13 AM, Duncan Murdoch wrote: On 11/7/2007 7:46 AM, Alexy Khrabrov wrote: Greetings -- coming from Python/Ruby perspective, I'm wondering about certain features of R as a programming language. Lots of question, I'll intersperse some answers. Say I have a huge table t