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

> ### Name: corAspect
> ### Title: Scaling by Maximizing Correlational Aspects
> ### Aliases: corAspect print.aspect summary.aspect
> ### Keywords: models
> 
> ### ** Examples
> 
> 
> ## maximizes the first eigenvalue
> data(galo)
> res.eig1 <- corAspect(galo[,1:4], aspect = "aspectEigen")
> res.eig1

Call:
corAspect(data = galo[, 1:4], aspect = "aspectEigen")

Value target function: 2.157

Correlation matrix of the transformed data:
       gender     IQ advice    SES
gender  1.000 -0.225 -0.153  0.263
IQ     -0.225  1.000  0.784 -0.359
advice -0.153  0.784  1.000 -0.381
SES     0.263 -0.359 -0.381  1.000

> summary(res.eig1)

Correlation matrix of the scaled data:
           gender         IQ     advice        SES
gender  1.0000000 -0.2250424 -0.1530434  0.2625045
IQ     -0.2250424  1.0000000  0.7838497 -0.3591809
advice -0.1530434  0.7838497  1.0000000 -0.3809925
SES     0.2625045 -0.3591809 -0.3809925  1.0000000


Eigenvalues of the correlation matrix:
[1] 2.1566364 0.9495205 0.6824798 0.2113632

Category scores:
gender:
        score
F -1.0156259
M  0.9846145

IQ:
        score
1 -1.4165321
2 -1.1543604
3 -1.2562031
4 -0.8641975
5 -0.4258116
6  0.4066503
7  1.3069583
8  2.2268649
9  2.6321133

advice:
           score
Agr   0.6933106
Ext  -1.0187239
Gen   0.4392874
Grls  0.2082299
Man  -0.7348860
None -1.0858279
Uni   2.0881269

SES:
            score
LoWC  -1.1292420
MidWC -0.8802974
Prof  -1.9149716
Shop   0.7380903
Skil   0.5207727
Unsk   2.5039191

> 
> ## maximizes the first 2 eigenvalues
> res.eig2 <- corAspect(galo[,1:4], aspect = "aspectEigen", p = 2)
> res.eig2

Call:
corAspect(data = galo[, 1:4], aspect = "aspectEigen", p = 2)

Value target function: 3.266

Correlation matrix of the transformed data:
       gender     IQ advice    SES
gender  1.000 -0.218 -0.127  0.455
IQ     -0.218  1.000  0.795 -0.104
advice -0.127  0.795  1.000 -0.028
SES     0.455 -0.104 -0.028  1.000

> 
> ## maximizes the absolute value of cubic correlations
> res.abs3 <- corAspect(galo[,1:4], aspect = "aspectAbs", pow = 3)
> res.abs3

Call:
corAspect(data = galo[, 1:4], aspect = "aspectAbs", pow = 3)

Value target function: 2.63

Correlation matrix of the transformed data:
       gender     IQ advice    SES
gender  1.000 -0.218 -0.136  0.245
IQ     -0.218  1.000  0.795 -0.357
advice -0.136  0.795  1.000 -0.378
SES     0.245 -0.357 -0.378  1.000

> 
> ## maximizes the sum of squared correlations
> res.cor2 <- corAspect(galo[,1:4], aspect = "aspectSum", pow = 2)
> res.cor2

Call:
corAspect(data = galo[, 1:4], aspect = "aspectSum", pow = 2)

Value target function: 6.078

Correlation matrix of the transformed data:
       gender     IQ advice    SES
gender  1.000 -0.222 -0.145  0.317
IQ     -0.222  1.000  0.791 -0.344
advice -0.145  0.791  1.000 -0.352
SES     0.317 -0.344 -0.352  1.000

> 
> ## maximizes the determinant
> res.det <- corAspect(galo[,1:4], aspect = "aspectDeterminant")
> res.det

Call:
corAspect(data = galo[, 1:4], aspect = "aspectDeterminant")

Value target function: 1.304

Correlation matrix of the transformed data:
       gender     IQ advice    SES
gender  1.000 -0.218 -0.130  0.450
IQ     -0.218  1.000  0.796 -0.217
advice -0.130  0.796  1.000 -0.170
SES     0.450 -0.217 -0.170  1.000

> 
> ## maximizes SMC, IQ as target variable
> res.smc <- corAspect(galo[,1:4], aspect = "aspectSMC", targvar = 2)
> res.smc

Call:
corAspect(data = galo[, 1:4], aspect = "aspectSMC", targvar = 2)

Value target function: 0.649

Correlation matrix of the transformed data:
       gender     IQ advice    SES
gender  1.000 -0.218 -0.126  0.323
IQ     -0.218  1.000  0.795 -0.284
advice -0.126  0.795  1.000 -0.253
SES     0.323 -0.284 -0.253  1.000

> 
> ## maximizes the sum of SMC
> res.sumsmc <- corAspect(galo[,1:4], aspect = "aspectSumSMC")
> res.sumsmc

Call:
corAspect(data = galo[, 1:4], aspect = "aspectSumSMC")

Value target function: 1.736

Correlation matrix of the transformed data:
       gender     IQ advice    SES
gender  1.000 -0.219 -0.126  0.460
IQ     -0.219  1.000  0.795 -0.146
advice -0.126  0.795  1.000 -0.078
SES     0.460 -0.146 -0.078  1.000

> 
> ## some user-defined non-sense aspect
> ## first list element corresponds to function value, second to first derivative
> myAspect <- function(r, a = 1, b = 1) list(a*b*r, matrix(a*b, nrow = nrow(r), ncol = ncol(r)))
> res.my <- corAspect(galo[,1:4], aspect = myAspect, a = 2, b = 4)
Error in ((f - fold) < eps) || (itel == itmax) : 
  'length = 16' in coercion to 'logical(1)'
Calls: corAspect
Execution halted