Re: [R] Does nargin and nargout work with R functions?

2009-11-29 Thread Jason Rupert
This works great. Thanks for your help. - Original Message From: baptiste auguie baptiste.aug...@googlemail.com To: Jason Rupert jasonkrup...@yahoo.com Cc: R-help R-help@r-project.org Sent: Thu, November 26, 2009 11:08:57 AM Subject: Re: [R] Does nargin and nargout work with R

[R] Does nargin and nargout work with R functions?

2009-11-26 Thread Jason Rupert
I am porting some MATLAB functions over to R and hopefully into a package, so I am curious if nargin and nargout work with R functions. Here is kind of an example of where I need to head in order to port control-1.0.11 from Octave over to R. The Octave control-1.0.11 package has the

Re: [R] Does nargin and nargout work with R functions?

2009-11-26 Thread baptiste auguie
Hi, I think you can use match.call() to retrieve the number of arguments passed to a function (see below), but I don't think nargout makes sense in R like it does in Matlab. foo - function(...){ print(match.call()) nargin - length(as.list(match.call())) -1 print(nargin) } foo(a=1, b=2)