From duncan@research.bell-labs.com  Tue Jul 25 12:12:09 2000
From: duncan@research.bell-labs.com (Duncan Temple Lang)
Date: Tue, 25 Jul 2000 07:12:09 -0400 (EDT)
Subject: [Rd] number of parameters of a function.
Message-ID: <200007251112.HAA06228@jessie.research.bell-labs.com>


 Is there a way to programmatically determine how many arguments a function
accepts? In S, one can compute this as 
          length(theFunction) - 1
and determine the parameter names  as
          names(theFunction)
due to the representation of functions.

(Just in case anyone is thinking of nargs(),  that is just for
particular calls and does not concern itself with the function
definition.)

Thanks,
  Duncan


-- 
_______________________________________________________________

Duncan Temple Lang                duncan@research.bell-labs.com
Bell Labs, Lucent Technologies    office: (908)582-3217
700 Mountain Avenue, Room 2C-259  fax:    (908)582-3340
Murray Hill, NJ  07974-2070       
         http://cm.bell-labs.com/stat/duncan

      "Languages shape the way we think, and determine what 
       we can think about."        
                                      Benjamin Whorf
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


[Rd] number of parameters of a function.
Duncan Temple Lang