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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: RnpdMAP
> ### Title: Generate Random NPD R matrices from a user-supplied population R
> ### Aliases: RnpdMAP
> ### Keywords: fungible
> 
> ### ** Examples
> 
> 
> library(MASS)
> 
> Nvar = 20
> Nfac = 4
> NSubj = 600
> Seed = 123    
> 
> set.seed(Seed)
> 
> ## Generate a vector of classical item difficulties
> p <- runif(Nvar)
> 
> cat("\nClassical Item Difficulties:\n")

Classical Item Difficulties:
> 
> print(rbind(1:Nvar,round(p,2)) )
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00 11.00 12.00 13.00 14.00
[2,] 0.29 0.79 0.41 0.88 0.94 0.05 0.53 0.89 0.55  0.46  0.96  0.45  0.68  0.57
     [,15] [,16] [,17] [,18] [,19] [,20]
[1,]  15.0  16.0 17.00 18.00 19.00 20.00
[2,]   0.1   0.9  0.25  0.04  0.33  0.95
> 
> summary(p)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
0.04206 0.31783 0.53977 0.55081 0.88537 0.95683 
> 
> 
> ## Convert item difficulties to quantiles
> b <- qnorm(p)
> 
> 
> ## fnc to compute root mean squared standard deviation
> RMSD <- function(A, B){
+   sqrt(mean( ( A[lower.tri(A, diag = FALSE)] - B[lower.tri(B, diag = FALSE)] )^2))
+ }
> 
> 
> ## Generate vector of eigenvalues with clear factor structure
>   L <- eigGen(nDimensions = Nvar, 
+             nMajorFactors = Nfac, 
+             PrcntMajor = .60, 
+             threshold  = .50)
>           
> 
> ## Generate a population R matrix with the eigenvalues in L
>   Rpop <- rGivens(eigs = L)$R
>   
> ## Generate continuous data that will reproduce Rpop (exactly)
>   X <- mvrnorm(n = NSubj, mu = rep(0, Nvar), 
+                Sigma = Rpop, empirical = TRUE)
>                
> if( any(colSums(X) == 0) ){
+   stop("One or more variables have zero variance. Generate a new data set.")               
+  }
>  
> ## Cut X at thresholds given in b to produce binary data U
>   U <- matrix(0, nrow(X), ncol(X))
>   for(j in 1:Nvar){
+     U[X[,j] <= b[j],j] <- 1
+   }
>   
> ## Compute tetrachoric correlations
>   Rtet <- tetcor(U, Smooth = FALSE, PRINT = TRUE)$r
Working on correlation:  2 1 
Working on correlation:  3 1 
Working on correlation:  3 2 
Working on correlation:  4 1 
Working on correlation:  4 2 
Working on correlation:  4 3 
Working on correlation:  5 1 
Working on correlation:  5 2 
Working on correlation:  5 3 
Working on correlation:  5 4 
Working on correlation:  6 1 
Working on correlation:  6 2 
Working on correlation:  6 3 
Working on correlation:  6 4 
Working on correlation:  6 5 
Working on correlation:  7 1 
Working on correlation:  7 2 
Working on correlation:  7 3 
Working on correlation:  7 4 
Working on correlation:  7 5 
Working on correlation:  7 6 
Working on correlation:  8 1 
Working on correlation:  8 2 
Working on correlation:  8 3 
Working on correlation:  8 4 
Working on correlation:  8 5 
Working on correlation:  8 6 
Working on correlation:  8 7 
Working on correlation:  9 1 
Working on correlation:  9 2 
Working on correlation:  9 3 
Working on correlation:  9 4 
Working on correlation:  9 5 
Working on correlation:  9 6 
Working on correlation:  9 7 
Working on correlation:  9 8 
Working on correlation:  10 1 
Working on correlation:  10 2 
Working on correlation:  10 3 
Working on correlation:  10 4 
Working on correlation:  10 5 
Working on correlation:  10 6 
Working on correlation:  10 7 
Working on correlation:  10 8 
Working on correlation:  10 9 
Working on correlation:  11 1 
Working on correlation:  11 2 
Working on correlation:  11 3 
Working on correlation:  11 4 
Working on correlation:  11 5 
Working on correlation:  11 6 
Working on correlation:  11 7 
Working on correlation:  11 8 
Working on correlation:  11 9 
Working on correlation:  11 10 
Working on correlation:  12 1 
Working on correlation:  12 2 
Working on correlation:  12 3 
Working on correlation:  12 4 
Working on correlation:  12 5 
Working on correlation:  12 6 
Working on correlation:  12 7 
Working on correlation:  12 8 
Working on correlation:  12 9 
Working on correlation:  12 10 
Working on correlation:  12 11 
Working on correlation:  13 1 
Working on correlation:  13 2 
Working on correlation:  13 3 
Working on correlation:  13 4 
Working on correlation:  13 5 
Working on correlation:  13 6 
Working on correlation:  13 7 
Working on correlation:  13 8 
Working on correlation:  13 9 
Working on correlation:  13 10 
Working on correlation:  13 11 
Working on correlation:  13 12 
Working on correlation:  14 1 
Working on correlation:  14 2 
Working on correlation:  14 3 
Working on correlation:  14 4 
Working on correlation:  14 5 
Working on correlation:  14 6 
Working on correlation:  14 7 
Working on correlation:  14 8 
Working on correlation:  14 9 
Working on correlation:  14 10 
Working on correlation:  14 11 
Working on correlation:  14 12 
Working on correlation:  14 13 
Working on correlation:  15 1 
Working on correlation:  15 2 
Working on correlation:  15 3 
Working on correlation:  15 4 
Working on correlation:  15 5 
Working on correlation:  15 6 
Working on correlation:  15 7 
Working on correlation:  15 8 
Working on correlation:  15 9 
Working on correlation:  15 10 
Working on correlation:  15 11 
Working on correlation:  15 12 
Working on correlation:  15 13 
Working on correlation:  15 14 
Working on correlation:  16 1 
Working on correlation:  16 2 
Working on correlation:  16 3 
Working on correlation:  16 4 
Working on correlation:  16 5 
Working on correlation:  16 6 
Working on correlation:  16 7 
Working on correlation:  16 8 
Working on correlation:  16 9 
Working on correlation:  16 10 
Working on correlation:  16 11 
Working on correlation:  16 12 
Working on correlation:  16 13 
Working on correlation:  16 14 
Working on correlation:  16 15 
Working on correlation:  17 1 
Working on correlation:  17 2 
Working on correlation:  17 3 
Working on correlation:  17 4 
Working on correlation:  17 5 
Working on correlation:  17 6 
Working on correlation:  17 7 
Working on correlation:  17 8 
Working on correlation:  17 9 
Working on correlation:  17 10 
Working on correlation:  17 11 
Working on correlation:  17 12 
Working on correlation:  17 13 
Working on correlation:  17 14 
Working on correlation:  17 15 
Working on correlation:  17 16 
Working on correlation:  18 1 
Working on correlation:  18 2 
Working on correlation:  18 3 
Working on correlation:  18 4 
Working on correlation:  18 5 
Working on correlation:  18 6 
Working on correlation:  18 7 
Working on correlation:  18 8 
Working on correlation:  18 9 
Working on correlation:  18 10 
Working on correlation:  18 11 
Working on correlation:  18 12 
Working on correlation:  18 13 
Working on correlation:  18 14 
Working on correlation:  18 15 
Working on correlation:  18 16 
Working on correlation:  18 17 
Working on correlation:  19 1 
Working on correlation:  19 2 
Working on correlation:  19 3 
Working on correlation:  19 4 
Working on correlation:  19 5 
Working on correlation:  19 6 
Working on correlation:  19 7 
Working on correlation:  19 8 
Working on correlation:  19 9 
Working on correlation:  19 10 
Working on correlation:  19 11 
Working on correlation:  19 12 
Working on correlation:  19 13 
Working on correlation:  19 14 
Working on correlation:  19 15 
Working on correlation:  19 16 
Working on correlation:  19 17 
Working on correlation:  19 18 
Working on correlation:  20 1 
Working on correlation:  20 2 
Working on correlation:  20 3 
Working on correlation:  20 4 
Working on correlation:  20 5 
Working on correlation:  20 6 
Working on correlation:  20 7 
Working on correlation:  20 8 
Working on correlation:  20 9 
Working on correlation:  20 10 
Working on correlation:  20 11 
Working on correlation:  20 12 
Working on correlation:  20 13 
Working on correlation:  20 14 
Working on correlation:  20 15 
Working on correlation:  20 16 
Working on correlation:  20 17 
Working on correlation:  20 18 
Working on correlation:  20 19 
>   # Calculate eigenvalues of tetrachoric R matrix
>   Ltet <- eigen(Rtet)$values
>   
>   if(Ltet[Nvar] >= 0) stop("Rtet is P(S)D")
Error: Rtet is P(S)D
Execution halted