0

I am trying to see the code for Sn or SnB methods in R but when I open the R function gofCopula in Copula package, I can't see the whole code. How can I access to the code for a specific method? This is the function example: gofCopula(copula, x, N=1000, method="SnB")

when I enter gofCopula I only see this:

function (copula, x, N = 1000, method = eval(formals(gofTstat)$method), 
    estim.method = eval(formals(fitCopula)$method), simulation = c("pb", 
        "mult"), verbose = TRUE, print.every = NULL, optim.method = "BFGS", 
    optim.control = list(maxit = 20), ...) 
{
    stopifnot(is(copula, "copula"), N >= 1)
    if (!is.matrix(x)) 
        x <- rbind(x, deparse.level = 0L)
    stopifnot((d <- ncol(x)) > 1, (n <- nrow(x)) > 0, dim(copula) == 
        d)
    method <- match.arg(method)
    estim.method <- match.arg(estim.method)
    optim.method <- match.arg(optim.method)
    simulation <- match.arg(simulation)
    stopifnot(optim.method %in% eval(formals(optim)$method))
    if (!is.null(print.every)) {
        warning("Argument 'print.every' is deprecated. Please use 'verbose' instead.")
        verbose <- print.every > 0
    }
    if (missing(estim.method) && !missing(method)) {
        eMeth <- eval(formals()$estim.method)
        if (!is.na(i <- pmatch(method, eMeth))) {
            warning("old (pre 0.999-*) argument 'method' is now called 'estim.method'")
            estim.method <- eMeth[i]
            method <- "Sn"
        }
    }
    switch(simulation, pb = {
        gofPB(copula, x, N = N, method = method, estim.method = estim.method, 
            verbose = verbose, optim.method = optim.method, optim.control = optim.control, 
            ...)
    }, mult = {
        gofMB(copula, x = x, N = N, method = method, estim.method = estim.method, 
            optim.method = optim.method, optim.control = optim.control, 
            ...)
    }, stop("Invalid simulation method ", simulation))
}
<environment: namespace:copula>
Ben Bolker
  • 211,554
  • 25
  • 370
  • 453
Fred
  • 223
  • 3
  • 14
  • 1
    Which method are you trying to see. you might want to look at `showMethods` or `getAnywhere`. The best thing would probably to download the source code from CRAN or wherever the package is hosted. And then simply browse the R directory. – Matt Bannert Oct 26 '13 at 19:26
  • 3
    Canonical answer for this is here: [How can I view the source code for a function?](http://stackoverflow.com/questions/19226816/how-can-i-view-the-source-code-for-a-function) – Ari B. Friedman Oct 26 '13 at 19:36

0 Answers0