Errors in running code in vignettes:
when running code in 'semPLS-intro.Rnw'

> options(list(prompt = "R> ", continue = "+  ", width = 78, 
+     useFancyQuotes = FALSE))

> library("semPLS")
Loading required package: lattice

> data("ECSIsm")

> ECSIsm
      source         target        
 [1,] "Image"        "Expectation" 
 [2,] "Expectation"  "Quality"     
 [3,] "Expectation"  "Value"       
 [4,] "Quality"      "Value"       
 [5,] "Image"        "Satisfaction"
 [6,] "Expectation"  "Satisfaction"
 [7,] "Quality"      "Satisfaction"
 [8,] "Value"        "Satisfaction"
 [9,] "Satisfaction" "Complaints"  
[10,] "Image"        "Loyalty"     
[11,] "Satisfaction" "Loyalty"     
[12,] "Complaints"   "Loyalty"     

> data("ECSImm")

> ECSImm
      source         target 
 [1,] "Image"        "IMAG1"
 [2,] "Image"        "IMAG2"
 [3,] "Image"        "IMAG3"
 [4,] "Image"        "IMAG4"
 [5,] "Image"        "IMAG5"
 [6,] "Expectation"  "CUEX1"
 [7,] "Expectation"  "CUEX2"
 [8,] "Expectation"  "CUEX3"
 [9,] "Quality"      "PERQ1"
[10,] "Quality"      "PERQ2"
[11,] "Quality"      "PERQ3"
[12,] "Quality"      "PERQ4"
[13,] "Quality"      "PERQ5"
[14,] "Quality"      "PERQ6"
[15,] "Quality"      "PERQ7"
[16,] "Value"        "PERV1"
[17,] "Value"        "PERV2"
[18,] "Satisfaction" "CUSA1"
[19,] "Satisfaction" "CUSA2"
[20,] "Satisfaction" "CUSA3"
[21,] "Complaints"   "CUSCO"
[22,] "Loyalty"      "CUSL1"
[23,] "Loyalty"      "CUSL2"
[24,] "Loyalty"      "CUSL3"

> ECSImm[ECSImm[, 1] == "Expectation", ]
     source        target 
[1,] "Expectation" "CUEX1"
[2,] "Expectation" "CUEX2"
[3,] "Expectation" "CUEX3"

> ECSImm[ECSImm[, 1] == "Expectation", 2:1]
     target  source       
[1,] "CUEX1" "Expectation"
[2,] "CUEX2" "Expectation"
[3,] "CUEX3" "Expectation"

> data("mobi")

> ECSI <- plsm(data = mobi, strucmod = ECSIsm, measuremod = ECSImm)
Warning in ncol(strucmod) != 2 || mode(strucmod) != "character" || class(strucmod) !=  :
  'length(x) = 2 > 1' in coercion to 'logical(1)'
Warning in ncol(measuremod) != 2 || mode(measuremod) != "character" || class(measuremod) !=  :
  'length(x) = 2 > 1' in coercion to 'logical(1)'

> mvpairs(model = ECSI, data = mobi, LVs = "Expectation")
Warning in par(usr) : argument 1 does not name a graphical parameter
Warning in par(usr) : argument 1 does not name a graphical parameter
Warning in par(usr) : argument 1 does not name a graphical parameter
Warning in par(usr) : argument 1 does not name a graphical parameter
Warning in par(usr) : argument 1 does not name a graphical parameter
Warning in par(usr) : argument 1 does not name a graphical parameter

> mvpairs(model = ECSI, data = mobi, LVs = "Expectation")
Warning in par(usr) : argument 1 does not name a graphical parameter
Warning in par(usr) : argument 1 does not name a graphical parameter
Warning in par(usr) : argument 1 does not name a graphical parameter
Warning in par(usr) : argument 1 does not name a graphical parameter
Warning in par(usr) : argument 1 does not name a graphical parameter
Warning in par(usr) : argument 1 does not name a graphical parameter

> ecsi <- sempls(model = ECSI, data = mobi, wscheme = "centroid")
All 250 observations are valid.
Converged after 6 iterations.
Tolerance: 1e-07
Scheme: centroid

> ecsi
                                Path Estimate
lam_1_1               Image -> IMAG1    0.743
lam_1_2               Image -> IMAG2    0.601
lam_1_3               Image -> IMAG3    0.578
lam_1_4               Image -> IMAG4    0.768
lam_1_5               Image -> IMAG5    0.744
lam_2_1         Expectation -> CUEX1    0.771
lam_2_2         Expectation -> CUEX2    0.687
lam_2_3         Expectation -> CUEX3    0.612
lam_3_1             Quality -> PERQ1    0.803
lam_3_2             Quality -> PERQ2    0.637
lam_3_3             Quality -> PERQ3    0.784
lam_3_4             Quality -> PERQ4    0.769
lam_3_5             Quality -> PERQ5    0.756
lam_3_6             Quality -> PERQ6    0.775
lam_3_7             Quality -> PERQ7    0.779
lam_4_1               Value -> PERV1    0.904
lam_4_2               Value -> PERV2    0.938
lam_5_1        Satisfaction -> CUSA1    0.799
lam_5_2        Satisfaction -> CUSA2    0.846
lam_5_3        Satisfaction -> CUSA3    0.852
lam_6_1          Complaints -> CUSCO    1.000
lam_7_1             Loyalty -> CUSL1    0.814
lam_7_2             Loyalty -> CUSL2    0.219
lam_7_3             Loyalty -> CUSL3    0.917
beta_1_2        Image -> Expectation    0.505
beta_2_3      Expectation -> Quality    0.557
beta_2_4        Expectation -> Value    0.051
beta_3_4            Quality -> Value    0.557
beta_1_5       Image -> Satisfaction    0.179
beta_2_5 Expectation -> Satisfaction    0.064
beta_3_5     Quality -> Satisfaction    0.513
beta_4_5       Value -> Satisfaction    0.192
beta_5_6  Satisfaction -> Complaints    0.526
beta_1_7            Image -> Loyalty    0.195
beta_5_7     Satisfaction -> Loyalty    0.483
beta_6_7       Complaints -> Loyalty    0.071

> names(ecsi)
 [1] "coefficients"      "path_coefficients" "outer_loadings"   
 [4] "cross_loadings"    "total_effects"     "inner_weights"    
 [7] "outer_weights"     "blocks"            "factor_scores"    
[10] "data"              "scaled"            "model"            
[13] "weighting_scheme"  "weights_evolution" "sum1"             
[16] "pairwise"          "method"            "iterations"       
[19] "convCrit"          "verbose"           "tolerance"        
[22] "maxit"             "N"                 "incomplete"       
[25] "Hanafi"           

> pC <- pathCoeff(ecsi)

> print(pC, abbreviate = TRUE, minlength = 3)
    Img   Exp   Qlt   Val   Sts   Cmp   Lyl
Img   . 0.505     .     . 0.179     . 0.195
Exp   .     . 0.557 0.051 0.064     .     .
Qlt   .     .     . 0.557 0.513     .     .
Val   .     .     .     . 0.192     .     .
Sts   .     .     .     .     . 0.526 0.483
Cmp   .     .     .     .     .     . 0.071
Lyl   .     .     .     .     .     .     .

> tE <- totalEffects(ecsi)

> print(tE, abbreviate = TRUE, minlength = 3)
    Img   Exp   Qlt   Val   Sts   Cmp   Lyl
Img   . 0.505 0.281 0.182 0.390 0.205 0.399
Exp   .     . 0.557 0.361 0.419 0.221 0.218
Qlt   .     .     . 0.557 0.619 0.326 0.323
Val   .     .     .     . 0.192 0.101 0.100
Sts   .     .     .     .     . 0.526 0.521
Cmp   .     .     .     .     .     . 0.071
Lyl   .     .     .     .     .     .     .

> plsWeights(ecsi)
      Image Expectation Quality Value Satisfaction Complaints Loyalty
IMAG1  0.30           .       .     .            .          .       .
IMAG2  0.26           .       .     .            .          .       .
IMAG3  0.22           .       .     .            .          .       .
IMAG4  0.33           .       .     .            .          .       .
IMAG5  0.32           .       .     .            .          .       .
CUEX1     .        0.52       .     .            .          .       .
CUEX2     .        0.47       .     .            .          .       .
CUEX3     .        0.45       .     .            .          .       .
PERQ1     .           .    0.21     .            .          .       .
PERQ2     .           .    0.14     .            .          .       .
PERQ3     .           .    0.20     .            .          .       .
PERQ4     .           .    0.18     .            .          .       .
PERQ5     .           .    0.18     .            .          .       .
PERQ6     .           .    0.18     .            .          .       .
PERQ7     .           .    0.21     .            .          .       .
PERV1     .           .       .  0.49            .          .       .
PERV2     .           .       .  0.60            .          .       .
CUSA1     .           .       .     .         0.38          .       .
CUSA2     .           .       .     .         0.38          .       .
CUSA3     .           .       .     .         0.44          .       .
CUSCO     .           .       .     .            .       1.00       .
CUSL1     .           .       .     .            .          .    0.45
CUSL2     .           .       .     .            .          .    0.13
CUSL3     .           .       .     .            .          .    0.66

> plsLoadings(ecsi)
      Image Expectation Quality Value Satisfaction Complaints Loyalty
IMAG1  0.74           .       .     .            .          .       .
IMAG2  0.60           .    0.50     .            .          .       .
IMAG3  0.58           .       .     .            .          .       .
IMAG4  0.77           .       .     .            .          .       .
IMAG5  0.74           .       .     .            .          .       .
CUEX1     .        0.77       .     .            .          .       .
CUEX2     .        0.69       .     .            .          .       .
CUEX3     .        0.61       .     .            .          .       .
PERQ1     .           .    0.80     .         0.68          .       .
PERQ2     .           .    0.64     .            .          .       .
PERQ3  0.63           .    0.78     .         0.64          .       .
PERQ4     .           .    0.77     .            .          .       .
PERQ5  0.61           .    0.76     .            .          .       .
PERQ6     .           .    0.78     .            .          .       .
PERQ7     .           .    0.78     .         0.70          .       .
PERV1     .           .       .  0.90            .          .       .
PERV2     .           .       .  0.94            .          .       .
CUSA1     .           .    0.64     .         0.80          .       .
CUSA2     .           .       .     .         0.85          .       .
CUSA3     .           .       .     .         0.85          .       .
CUSCO     .           .       .     .            .       1.00       .
CUSL1     .           .       .     .            .          .    0.81
CUSL2     .           .       .     .            .          .    0.22
CUSL3     .           .       .     .            .          .    0.92

> densityplot(ecsi, use = "residuals")

> plot(ecsi)

> densityplot(ecsi, use = "residuals")

> ptf_ecsiBoot <- system.file("semPLS-intro", "data", 
+     "ecsiBoot.rda", package = "semPLS")

> load(ptf_ecsiBoot)

> ptf_ecsiBootsummary <- system.file("semPLS-intro", 
+     "data", "ecsiBootsummary.rda", package = "semPLS")

> load(ptf_ecsiBootsummary)

> ecsiBoot
Call: bootsempls(object = ecsi, nboot = 500, start = "ones", verbose = FALSE)

                            Estimate      Bias Std.Error
Image -> IMAG1                0.7434 -0.004463  4.31e-02
Image -> IMAG2                0.6007 -0.001859  5.80e-02
Image -> IMAG3                0.5776 -0.004403  6.31e-02
Image -> IMAG4                0.7684 -0.002188  4.47e-02
Image -> IMAG5                0.7445  0.001691  3.01e-02
Expectation -> CUEX1          0.7715 -0.006157  5.23e-02
Expectation -> CUEX2          0.6866 -0.002187  8.52e-02
Expectation -> CUEX3          0.6118 -0.000381  7.59e-02
Quality -> PERQ1              0.8033  0.001853  2.34e-02
Quality -> PERQ2              0.6374 -0.004122  5.19e-02
Quality -> PERQ3              0.7835  0.001389  2.97e-02
Quality -> PERQ4              0.7691 -0.002988  4.52e-02
Quality -> PERQ5              0.7558 -0.001085  3.92e-02
Quality -> PERQ6              0.7752 -0.002527  5.75e-02
Quality -> PERQ7              0.7794  0.001324  3.12e-02
Value -> PERV1                0.9043 -0.002026  2.22e-02
Value -> PERV2                0.9379  0.000318  8.07e-03
Satisfaction -> CUSA1         0.7990 -0.001989  3.04e-02
Satisfaction -> CUSA2         0.8462 -0.001261  2.28e-02
Satisfaction -> CUSA3         0.8519 -0.000138  1.75e-02
Complaints -> CUSCO           1.0000  0.000000  5.17e-17
Loyalty -> CUSL1              0.8138 -0.002456  4.03e-02
Loyalty -> CUSL2              0.2191  0.001473  9.65e-02
Loyalty -> CUSL3              0.9168 -0.001029  1.19e-02
Image -> Expectation          0.5047  0.007683  5.87e-02
Expectation -> Quality        0.5572  0.004379  5.35e-02
Expectation -> Value          0.0508  0.011914  8.46e-02
Quality -> Value              0.5572 -0.007401  8.41e-02
Image -> Satisfaction         0.1788  0.008076  5.08e-02
Expectation -> Satisfaction   0.0644 -0.004120  4.83e-02
Quality -> Satisfaction       0.5125 -0.005184  6.49e-02
Value -> Satisfaction         0.1918  0.001316  5.87e-02
Satisfaction -> Complaints    0.5261  0.001322  5.20e-02
Image -> Loyalty              0.1954  0.006120  7.65e-02
Satisfaction -> Loyalty       0.4835 -0.004741  8.57e-02
Complaints -> Loyalty         0.0712  0.000369  5.55e-02

> ecsiBootsummary
Call: bootsempls(object = ecsi, nboot = 500, start = "ones", verbose = FALSE)

Lower and upper limits are for the 90 percent bca confidence interval

         Estimate      Bias Std.Error    Lower Upper
lam_1_1    0.7434 -0.004463  4.31e-02  0.65788 0.799
lam_1_2    0.6007 -0.001859  5.80e-02  0.49794 0.689
lam_1_3    0.5776 -0.004403  6.31e-02  0.44906 0.660
lam_1_4    0.7684 -0.002188  4.47e-02  0.67570 0.825
lam_1_5    0.7445  0.001691  3.01e-02  0.68441 0.787
lam_2_1    0.7715 -0.006157  5.23e-02  0.65638 0.831
lam_2_2    0.6866 -0.002187  8.52e-02  0.51959 0.798
lam_2_3    0.6118 -0.000381  7.59e-02  0.44677 0.715
lam_3_1    0.8033  0.001853  2.34e-02  0.75399 0.838
lam_3_2    0.6374 -0.004122  5.19e-02  0.54288 0.714
lam_3_3    0.7835  0.001389  2.97e-02  0.72151 0.821
lam_3_4    0.7691 -0.002988  4.52e-02  0.68072 0.837
lam_3_5    0.7558 -0.001085  3.92e-02  0.67852 0.813
lam_3_6    0.7752 -0.002527  5.75e-02  0.65748 0.853
lam_3_7    0.7794  0.001324  3.12e-02  0.70761 0.817
lam_4_1    0.9043 -0.002026  2.22e-02  0.85289 0.930
lam_4_2    0.9379  0.000318  8.07e-03  0.92111 0.949
lam_5_1    0.7990 -0.001989  3.04e-02  0.74262 0.843
lam_5_2    0.8462 -0.001261  2.28e-02  0.80460 0.878
lam_5_3    0.8519 -0.000138  1.75e-02  0.81982 0.878
lam_6_1    1.0000  0.000000  5.17e-17        .     .
lam_7_1    0.8138 -0.002456  4.03e-02  0.72931 0.866
lam_7_2    0.2191  0.001473  9.65e-02  0.04211 0.365
lam_7_3    0.9168 -0.001029  1.19e-02  0.89681 0.934
beta_1_2   0.5047  0.007683  5.87e-02  0.38627 0.579
beta_2_3   0.5572  0.004379  5.35e-02  0.46267 0.638
beta_2_4   0.0508  0.011914  8.46e-02 -0.08127 0.192
beta_3_4   0.5572 -0.007401  8.41e-02  0.41834 0.692
beta_1_5   0.1788  0.008076  5.08e-02  0.09167 0.248
beta_2_5   0.0644 -0.004120  4.83e-02 -0.00649 0.152
beta_3_5   0.5125 -0.005184  6.49e-02  0.40264 0.615
beta_4_5   0.1918  0.001316  5.87e-02  0.09251 0.288
beta_5_6   0.5261  0.001322  5.20e-02  0.43602 0.612
beta_1_7   0.1954  0.006120  7.65e-02  0.04689 0.313
beta_5_7   0.4835 -0.004741  8.57e-02  0.35094 0.622
beta_6_7   0.0712  0.000369  5.55e-02 -0.01587 0.169

> print(densityplot(ecsiBoot, pattern = "beta"))

> ECSI[["blocks"]]["Expectation"]
$Expectation
[1] "CUEX1" "CUEX2" "CUEX3"
attr(,"mode")
[1] "A"


> invertLVs(model = ECSI, LVs = c("Expectation"))[["blocks"]]["Expectation"]
$Expectation
[1] "CUEX1" "CUEX2" "CUEX3"
attr(,"mode")
[1] "B"


> ECSI[["D"]]
             Image Expectation Quality Value Satisfaction Complaints Loyalty
Image            0           1       0     0            1          0       1
Expectation      0           0       1     1            1          0       0
Quality          0           0       0     1            1          0       0
Value            0           0       0     0            1          0       0
Satisfaction     0           0       0     0            0          1       1
Complaints       0           0       0     0            0          0       1
Loyalty          0           0       0     0            0          0       0

> addPath(model = ECSI, from = "Quality", to = "Loyalty")[["D"]]
Warning in ncol(strucmod) != 2 || mode(strucmod) != "character" || class(strucmod) !=  :
  'length(x) = 2 > 1' in coercion to 'logical(1)'
Warning in ncol(measuremod) != 2 || mode(measuremod) != "character" || class(measuremod) !=  :
  'length(x) = 2 > 1' in coercion to 'logical(1)'
             Image Expectation Quality Value Satisfaction Complaints Loyalty
Image            0           1       0     0            1          0       1
Expectation      0           0       1     1            1          0       0
Quality          0           0       0     1            1          0       1
Value            0           0       0     0            1          0       0
Satisfaction     0           0       0     0            0          1       1
Complaints       0           0       0     0            0          0       1
Loyalty          0           0       0     0            0          0       0

> removePath(model = ECSI, from = "Image", to = c("Satisfaction", 
+     "Loyalty"))[["D"]]
Warning in ncol(strucmod) != 2 || mode(strucmod) != "character" || class(strucmod) !=  :
  'length(x) = 2 > 1' in coercion to 'logical(1)'
Warning in ncol(measuremod) != 2 || mode(measuremod) != "character" || class(measuremod) !=  :
  'length(x) = 2 > 1' in coercion to 'logical(1)'
             Image Expectation Quality Value Satisfaction Complaints Loyalty
Image            0           1       0     0            0          0       0
Expectation      0           0       1     1            1          0       0
Quality          0           0       0     1            1          0       0
Value            0           0       0     0            1          0       0
Satisfaction     0           0       0     0            0          1       1
Complaints       0           0       0     0            0          0       1
Loyalty          0           0       0     0            0          0       0

> library("matrixcalc", pos = which(search() == "package:semPLS") + 
+     1)

  When sourcing 'semPLS-intro.R':
Error: there is no package called 'matrixcalc'
Execution halted

  'semPLS-intro.Rnw'... failed