Re: [R] Multiple line commands in R scripting

2009-10-26 Thread Neil Stewart
I guess I'll have to be really careful about my line breaks. Thank you all for your help! __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and p

Re: [R] Multiple line commands in R scripting

2009-10-25 Thread Jim Lemon
Neil Stewart wrote: > > I'm wondering whether there is a character to let R know to expect > more input for a command on subsequent lines. Hi Neil, Not that I know of, but I use exactly the method you noticed, the trailing operator. There was a discussion similar to this not long ago about the

Re: [R] Multiple line commands in R scripting

2009-10-25 Thread Peter Ehlers
Peter Ehlers wrote: As usual, you're Duncan. Should have tested it. Thanks for the correction. Well, at least I assume that you're still Duncan. Meant to say, of course: "as usual, you're _right_, Duncan". Particularly slow fingers today. Please accept apology. -Peter Ehlers -Peter Ehle

Re: [R] Multiple line commands in R scripting

2009-10-25 Thread Peter Ehlers
As usual, you're Duncan. Should have tested it. Thanks for the correction. -Peter Ehlers Duncan Murdoch wrote: On 25/10/2009 11:43 AM, Peter Ehlers wrote: Here are two ways: 1. wrap the line in braces: x <- { /...} That doesn't work. You're probably thinking of the way the

Re: [R] Multiple line commands in R scripting

2009-10-25 Thread Duncan Murdoch
On 25/10/2009 11:43 AM, Peter Ehlers wrote: Here are two ways: 1. wrap the line in braces: x <- { /...} That doesn't work. You're probably thinking of the way the parsing of if versus if/else depends on braces: if (TRUE) print("TRUE") else print("FALSE") is a syntax error

Re: [R] Multiple line commands in R scripting

2009-10-25 Thread Peter Ehlers
Here are two ways: 1. wrap the line in braces: x <- { /...} 2. maybe more awkward in general, but sometimes useful: x <- `/`(... , ...) -Peter Ehlers Neil Stewart wrote: I'm wondering whether there is a character to let R know to expect more input for a command on subse

Re: [R] Multiple line commands in R scripting

2009-10-25 Thread David Winsemius
On Oct 25, 2009, at 8:53 AM, Neil Stewart wrote: I'm wondering whether there is a character to let R know to expect more input for a command on subsequent lines. Here is an example: test_1.R: x <- c(1,2,3,4) / c(1,2,3,4) x R CMD BATCh test_1.R produces test_1.Rout: x <- c(1,2,3,4) / c(

Re: [R] Multiple line commands in R scripting

2009-10-25 Thread Duncan Murdoch
On 25/10/2009 8:53 AM, Neil Stewart wrote: I'm wondering whether there is a character to let R know to expect more input for a command on subsequent lines. Here is an example: No, the rule R uses is to stop when the statement is complete. test_1.R: x <- c(1,2,3,4) / c(1,2,3,4) x The fir

[R] Multiple line commands in R scripting

2009-10-25 Thread Neil Stewart
I'm wondering whether there is a character to let R know to expect more input for a command on subsequent lines. Here is an example: test_1.R: x <- c(1,2,3,4) / c(1,2,3,4) x R CMD BATCh test_1.R produces test_1.Rout: > x <- c(1,2,3,4) > / c(1,2,3,4) Error: unexpected '/' in " /" Execution