Running examples in ‘FDGcopulas-Ex.R’ failed
The error most likely occurred in:

> ### Name: FDGcopulas-package
> ### Title: Deals with FDG copulas
> ### Aliases: FDGcopulas-package
> ### Keywords: copula multivariate
> 
> ### ** Examples
> 
> ## creates an object of class 'FDGcopula' 
> myFDGcopula <- FDGcopula("frechet", c(.3,.5,.7,.9))
> 
> ## compute the pairwise dependence coefficients 
> ## Spearman's rho:
> rhoFDG(myFDGcopula)
     [,1] [,2] [,3] [,4]
[1,] 1.00 0.15 0.21 0.27
[2,] 0.15 1.00 0.35 0.45
[3,] 0.21 0.35 1.00 0.63
[4,] 0.27 0.45 0.63 1.00
> ## Kendall's tau:
> tauFDG(myFDGcopula)
       [,1]      [,2]      [,3]   [,4]
[1,] 1.0000 0.1075000 0.1547000 0.2043
[2,] 0.1075 1.0000000 0.2741667 0.3675
[3,] 0.1547 0.2741667 1.0000000 0.5523
[4,] 0.2043 0.3675000 0.5523000 1.0000
> ## Upper tail dependence coefficient:
> utdcFDG(myFDGcopula)
     [,1] [,2] [,3] [,4]
[1,] 1.00 0.15 0.21 0.27
[2,] 0.15 1.00 0.35 0.45
[3,] 0.21 0.35 1.00 0.63
[4,] 0.27 0.45 0.63 1.00
> ## Lower tail dependence coefficient:
> ltdcFDG(myFDGcopula)
     [,1] [,2] [,3] [,4]
[1,] 1.00 0.15 0.21 0.27
[2,] 0.15 1.00 0.35 0.45
[3,] 0.21 0.35 1.00 0.63
[4,] 0.27 0.45 0.63 1.00
> 
> ## simulates data ##
> dat <- rFDG(30, myFDGcopula)
> 
> ## fit data ##
> myFittedCopula <- fitFDG(myFDGcopula, dat)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
FDGcopulas
 --- call from context --- 
fitFDG(myFDGcopula, dat)
 --- call from argument --- 
if (class(invJtJ) == "try-error") {
    matrix(ncol = d, nrow = d, NA)
} else {
    invJtJ %*% t(J) %*% Sigma %*% J %*% invJtJ
}
 --- R stacktrace ---
where 1: fitFDG(myFDGcopula, dat)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (FDGcopula, data, depcoefType = "spearman", nbInit = 1, 
    W = NA, method = "L-BFGS-B", estimate.variance = TRUE, nb.rep = 100, 
    nb.obs = 100, dcData = NA, sizeSubSample = 10000) 
{
    if (!depcoefType %in% c("spearman", "kendall", "utdc")) {
        stop("'depcoefType' should be one of 'spearman', 'kendall', or 'utdc'")
    }
    else {
    }
    if (FDGcopula@extremevalue == TRUE & FDGcopula@family == 
        "exponential") {
        stop("The extreme-value copula coming from the FDG copula with exponential generators is the INDEPENDENCE copula!")
    }
    else {
    }
    d <- length(FDGcopula@parameters)
    p <- d * (d - 1)/2
    if (is.na(W) == TRUE) {
        W <- diag(1, p)
    }
    else {
    }
    if (is.na(sum(dcData))) {
        dcData <- corFDG(data, depcoefType)
        if (depcoefType == "utdc" & FDGcopula@extremevalue == 
            FALSE) {
            stop("The upper tail dependence coefficient estimator implemented by default is theoretically well grounded ONLY for extreme-value copulas. If you still wanna do this way, use your own estimator by providing 'dcData'")
        }
        else {
        }
    }
    else {
    }
    optimResults <- wlsdc(FDGcopula, dcData, depcoefType, nbInit, 
        W, method)
    Sigma <- if (estimate.variance) {
        asymp.vcov(nb.rep, nb.obs, FDGcopula, depcoefType, sizeSubSample)
    }
    else {
        matrix(ncol = p, nrow = p, rep(NA, p * p))
    }
    fittedFDG <- FDGcopula(FDGcopula@family, optimResults$estimate, 
        FDGcopula@extremevalue)
    J <- JacobianFDG(fittedFDG, depcoefType)
    invJtJ <- try(solve(t(J) %*% J, diag(1, d)))
    Xi <- if (class(invJtJ) == "try-error") {
        matrix(ncol = d, nrow = d, NA)
    }
    else {
        invJtJ %*% t(J) %*% Sigma %*% J %*% invJtJ
    }
    new(Class = "fitFDG", estimate = optimResults$estimate, var.est = Xi, 
        optimalvalues = optimResults$optimalValues, convergence = optimResults$convergenceDiagnostic, 
        FDGcopula = fittedFDG)
}
<bytecode: 0x437e820>
<environment: namespace:FDGcopulas>
 --- function search by body ---
Function fitFDG in namespace FDGcopulas has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(invJtJ) == "try-error") { : 
  the condition has length > 1
Calls: fitFDG
Execution halted