SCM

SCM Repository

[rmetrics] View of /pkg/timeSeries/R/utils-getArgs.R
ViewVC logotype

View of /pkg/timeSeries/R/utils-getArgs.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4705 - (download) (annotate)
Sat Jan 23 00:47:52 2010 UTC (9 years ago) by wuertz
File size: 793 byte(s)
internal function .getArgs added

################################################################################


.getArgs <- 
    function(f, signature = character())  
{
    # A function implemented by Diethelm Wuertz
    
    # Examples:
    #   getArgs(returns)
    #   getArgs("returns")
    #   getArgs(returns, "timeSeries") 
    #   getArgs("returns", "timeSeries")
    
    # FUNCTION:
    
    fun = getMethod(f, signature)@.Data 
    test = class(try(body(fun)[[2]][[3]], silent = TRUE))
    if (test == "function") {
        ans = args(body(fun)[[2]][[3]])
    } else {
        ans = args(fun)
    } 
    cat(substitute(f), ",", signature, ":\n", sep = "")
    
    # Return Value:
    ans
}


################################################################################


R-Forge@R-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business University of Wisconsin - Madison Powered By FusionForge