Running examples in 'stheoreme-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: cxds.stheorem
> ### Title: Renormalized Entropy Shift Estimation
> ### Aliases: cxds.stheorem
> 
> ### ** Examples
> 
> #quazi-gaussian probability vectors with equal means & different variances
> f0 <- c(0.0,0.1,0.4,0.4,0.1,0.0)
> f1 <- c(0.1,0.15,0.25,0.25,0.15,0.1)
> cxds.stheorem(distribution0=f0, distribution1=f1)

 S-theorem open system evolution model

Overall entropy shift {H1-H0 = dS + dI}:
0.529250590526317 {0to1} = 0.0909350028886473 {0to1} + 0.438315587637669 {0to1}
> 
> #quazi-gaussian bin counts with shift between means
> h0 <- c(2,2,17,6,1,1,1,0)
> h1 <- c(2,3,5,7,7,4,1,0)
> crit.stheorem(h0, h1)

 S-theorem convergence criterion

System evolution from state0 to state1 is thermodynamically possible through an indirect
 medium state2 (R^2 = 0.8836).

> cxds.stheorem(h0, h1)

 S-theorem open system evolution model

Overall entropy shift {H1-H0 = dS + dI}:
0.452797516823042 {0to1} = -0.125108179247243 {0to1} + 0.577905696070284 {0to1}
where dS consists of two:
-0.125108179247243 {0to1} = -0.124496242898291 {0to2} + -0.000611936348951181 {2to1}

> 
> #example of 2-step analysis with Klimontovich's S-theorem for 2 
> # arrays of outcomes {s0,s1}:
> s0<-rep(c(1:11,2),256)
> s1<-rep(c(2,3,3,4,5,5,5),55)
> # step a. Create probability vectors
> b<-d1nat(s0,s1,brks=12); b
Call:
d1nat.default(sample0 = s0, sample1 = s1, brks = 12)
Two probability mass functions ($f0,$f1) have been generated at the common scale of values ($midpoints)
Statistics summary:
     expctd       var fsum xmin xmax  n mod1     mod2     mod3    H_val
f0 5.652778 9.3123071    1    1   11 12 2.25 1.416667 3.083333 2.369382
f1 3.797619 0.8786848    1    1   11 12 4.75 3.083333 2.250000 1.277034
      H_max
f0 2.484907
f1 2.484907
> # step b. Compare samples with Klimontovich's S-theorem
> crit.stheorem(b$f0,b$f1)

 S-theorem convergence criterion

System evolution from state0 to state1 is thermodynamically possible through an indirect
 medium state2 (R^2 = 0.9604).

> cxds.stheorem(b$f0,b$f1)

 S-theorem open system evolution model

Overall entropy shift {H1-H0 = dS + dI}:
-1.0923478602283 {0to1} = 0.0638527099574505 {0to1} + -1.15620057018575 {0to1}
where dS consists of two:
0.0638527099574505 {0to1} = 1e-15 {0to2} + 0.0638527099574495 {2to1}

> 
> #example of 3-step analysis with Klimontovich's S-theorem to study two gratings
> # random vs regular
> s0<-array(c(rep(0,640),rep(1,640)), c(320,320))
> s1<-array(runif(5120,0,1), c(64,80))
> # step a. Binarize (to make s1 comparable with s0 by its nature as a grating)
> a<-utild2bin(s0, s1, method='med')
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
stheoreme
 --- call from context --- 
utild2bin(s0, s1, method = "med")
 --- call from argument --- 
if (class(d2arr0) != "matrix" | class(d2arr1) != "matrix") {
    stop("One of the arrays has < 2 dimensions")
}
 --- R stacktrace ---
where 1: utild2bin(s0, s1, method = "med")

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (d2arr0, d2arr1, method = "mean", trsh = 0, inverted = FALSE) 
{
    if (class(d2arr0) != "matrix" | class(d2arr1) != "matrix") {
        stop("One of the arrays has < 2 dimensions")
    }
    return(utild1bin(d2arr0, d2arr1, method = method, trsh = trsh, 
        inverted = inverted, d2 = TRUE))
}
<bytecode: 0x1457428>
<environment: namespace:stheoreme>
 --- function search by body ---
Function utild2bin in namespace stheoreme has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(d2arr0) != "matrix" | class(d2arr1) != "matrix") { : 
  the condition has length > 1
Calls: utild2bin
Execution halted