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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: varianceReduction
> ### Title: Variance-Reduction Methods
> ### Aliases: rAntitheticVariates rLatinHypercube
> ### Keywords: distribution methods
> 
> ### ** Examples
> 
> ### 1 Basic plots ##############################################################
> 
> ## Generate data from a Gumbel copula
> cop <- gumbelCopula(iTau(gumbelCopula(), tau = 0.5))
> n <- 1e4
> set.seed(271)
> U <- rCopula(n, copula = cop)
> 
> ## Transform the sample to a Latin Hypercube sample
> U.LH <- rLatinHypercube(U)
> 
> ## Plot
> ## Note: The 'variance-reducing property' is barely visible, but that's okay
> layout(rbind(1:2))
> plot(U,    xlab = quote(U[1]), ylab = quote(U[2]), pch = ".", main = "U")
> plot(U.LH, xlab = quote(U[1]), ylab = quote(U[2]), pch = ".", main = "U.LH")
> layout(1) # reset layout
> 
> ## Transform the sample to an Antithetic variate sample
> U.AV <- rAntitheticVariates(U)
> stopifnot(identical(U.AV[,,1],  U ),
+           identical(U.AV[,,2], 1-U))
> 
> ## Plot original sample and its corresponding (componentwise) antithetic variates
> layout(rbind(1:2))
> plot(U.AV[,,1], xlab = quote(U[1]), ylab = quote(U[2]), pch=".", main= "U")
> plot(U.AV[,,2], xlab = quote(U[1]), ylab = quote(U[2]), pch=".", main= "1 - U")
> layout(1) # reset layout
> 
> 
> ### 2 Small variance-reduction study for exceedance probabilities ##############
> 
> ## Auxiliary function for approximately computing P(U_1 > u_1,..., U_d > u_d)
> ## by Monte Carlo simulation based on pseudo-random numbers, Latin hypercube
> ## sampling and quasi-random numbers.
> sProb <- function(n, copula, u)
+ {
+     d <- length(u)
+     stopifnot(n >= 1, inherits(copula, "Copula"), 0 < u, u < 1,
+               d == dim(copula))
+     umat <- rep(u, each = n)
+     ## Pseudo-random numbers
+     U <- rCopula(n, copula = copula)
+     PRNG <- mean(rowSums(U > umat) == d)
+     ## Latin hypercube sampling (based on the recycled 'U')
+     U. <- rLatinHypercube(U)
+     LHS <- mean(rowSums(U. > umat) == d)
+     ## Quasi-random numbers
+     U.. <- cCopula(sobol(n, d = d, randomize = TRUE), copula = copula,
+                    inverse = TRUE)
+     QRNG <- mean(rowSums(U.. > umat) == d)
+     ## Return
+     c(PRNG = PRNG, LHS = LHS, QRNG = QRNG)
+ }
> 
> ## Simulate the probabilities of falling in (u_1,1] x ... x (u_d,1]
> library(qrng) # for quasi-random numbers
Error in library(qrng) : there is no package called ‘qrng’
Execution halted