Re: [R] Variable Argument Function

2016-02-07 Thread Duncan Murdoch
On 07/02/2016 7:14 PM, Ben Tupper wrote: Hi, On Feb 7, 2016, at 6:24 PM, Duncan Murdoch wrote: On 07/02/2016 6:12 PM, Robert Sherry wrote: I would like to write a function in R that would take a variable number of integers as parameters. I do not have a pressing reason to do this, I am just

Re: [R] Variable Argument Function

2016-02-07 Thread Robert Sherry
Ben, Your solution solved my issue. Thank you. I do not see a need for a nested function. Based upon your solution, I came up with this solution: fbob = function (...) { l1 = list(...) for( i in 1:length(l1) ) cat( "i is ", l1[[i]], "\n" ) return (0); } It does not use nes

Re: [R] Variable Argument Function

2016-02-07 Thread Ben Tupper
Hi, > On Feb 7, 2016, at 6:24 PM, Duncan Murdoch wrote: > > On 07/02/2016 6:12 PM, Robert Sherry wrote: >> >> I would like to write a function in R that would take a variable number >> of integers as parameters. I do not have a pressing reason to do this, I >> am just trying to learn R. I thoug

Re: [R] Variable Argument Function

2016-02-07 Thread Duncan Murdoch
On 07/02/2016 6:12 PM, Robert Sherry wrote: I would like to write a function in R that would take a variable number of integers as parameters. I do not have a pressing reason to do this, I am just trying to learn R. I thought a good first step would be to print out the arguments. So I wrote the

[R] Variable Argument Function

2016-02-07 Thread Robert Sherry
I would like to write a function in R that would take a variable number of integers as parameters. I do not have a pressing reason to do this, I am just trying to learn R. I thought a good first step would be to print out the arguments. So I wrote the following function: f1 = function (...)