RÓïÑÔÁгöS3·ºÐͺ¯Êý»òÀàµÄ·½·¨methods()º¯Êý-ÖÐÓ¢ÎĶÔÕÕ°ïÖúÎĵµ
By MicroRbt Martinez PhD
RÓïÑÔº¯ÊýÃû£ºmethods()
RÓïÑÔº¯Êý¹¦ÄÜ£ºÁгöS3·ºÐͺ¯Êý»òÀàµÄ·½·¨
À´×Ô×ÊÔ´¿â£º»ù´¡¿â£¨RÓïÑÔ×Ô´ø£©
methods()º¯ÊýËùÊôRÓïÑÔ°ü£ºËùÔÚR°ü¾ßÌåÃû³Æ¡¢°ü¹¦ÄܵÄÖÐÓ¢ÎÄË«ÓïÃèÊö¼ûÕýÎĺóÃæ'--ËùÔÚRÓïÑÔ°üÐÅÏ¢--'²¿·Ö¡£
ÃèÊö-----Description-----
List all available methods for a S3 and S4 generic function, or all methods for an S3 or S4 class.
ÁгöS3ºÍS4·ºÐͺ¯ÊýµÄËùÓпÉÓ÷½·¨£¬»òS3»òS4ÀàµÄËùÓз½·¨¡£
ʹÓ÷½·¨-----Usage-----
methods(generic.function, class)
.S3methods(generic.function, class, envir=parent.frame())
## S3 method for class 'MethodsFunction' S3 method for class 'MethodsFunction'
format(x, byclass = attr(x, "byclass"), ...)
## S3 method for class 'MethodsFunction' S3 method for class 'MethodsFunction'
print(x, byclass = attr(x, "byclass"), ...)
²ÎÊý-----Arguments-----
²ÎÊýgeneric.function½éÉÜ: a generic function, or a character string naming a generic function.
ͨÓú¯Êý£¬»òÃüÃûͨÓú¯ÊýµÄ×Ö·û´®¡£
²ÎÊýclass½éÉÜ: a symbol or character string naming a class: only used if generic.function is not supplied.
ÃüÃûÀàµÄ·ûºÅ»ò×Ö·û´®£º½öµ±Î´Ìṩgeneric.functionʱʹÓá£
²ÎÊýenvir½éÉÜ: the environment in which to look for the definition of the generic function, when the generic function is passed as a character string.
µ±Í¨Óú¯Êý×÷Ϊ×Ö·û´®´«µÝʱ£¬ÔÚÆäÖÐÑ°ÕÒͨÓú¯Êý¶¨ÒåµÄ»·¾³¡£
²ÎÊýx½éÉÜ: typically the result of methods(..), an R object of S3 class "MethodsFunction", see Value below.
ͨ³£ÊÇmethods(..)c£¨S3Àà"MethodsFunction"µÄR¶ÔÏ󣩵Ľá¹û£¬Çë²Î¼ûÏÂÃæµÄValue¡£
²ÎÊýbyclass½éÉÜ: an optional logical allowing to override the "byclass" attribute determining how the result is printed, see Details .
ÔÊÐí¸²¸Ç"byclass"ÊôÐÔ²¢È·¶¨ÈçºÎ´òÓ¡½á¹ûµÄ¿ÉÑ¡logical£¬Çë²Î¼ûDetails¡£
²ÎÊý...½éÉÜ: potentially further arguments passed to and from methods; unused currently.
·½·¨¿ÉÄÜ´«µÝµÄÆäËû²ÎÊý£»µ±Ç°Î´Ê¹Óá£
ÏêÇé-----Details-----
methods() finds S3 and S4 methods associated with either the generic.function or class argument. Methods are found in all packages on the current search() path. .S3methods() finds only S3 methods, .S4methods() finds only only S4 methods.
methods()²éÕÒÓëgeneric.function»òclass²ÎÊý¹ØÁªµÄS3ºÍS4·½·¨¡£·½·¨¿ÉÔÚµ±Ç°search()·¾¶ÉϵÄËùÓ
-----δÍ꣬´ýÐø-----£¬¡ý¡ý¡ýÕ¹¿ªÊ£Óà72%¡ý¡ý¡ý
|