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

Jason Rupert jasonkrupert at yahoo.com
Thu Nov 26 17:57:33 CET 2009


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 capability to produce bode plots of transfer functions.  I hope to post this package once the port over to R is complete.    

Thanks again for all the feedback and insights. 

bode<-function(sys, w, outputs, inputs, plot_style)
{

# ...

if (nargin < 1 || nargin > 5)
{
        print("This works")
}

if (nargout < 1)
{
       print("This also works") 
}

return(list(mag_r, phase_r, w_r))

}




More information about the R-help mailing list