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

> ### Name: estimate_contrasts
> ### Title: Estimate Marginal Contrasts
> ### Aliases: estimate_contrasts
> 
> ### ** Examples
> 
> ## Don't show: 
> if (requireNamespace("emmeans", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)({ # examplesIf
+ ## End(Don't show)
+ # Basic usage
+ model <- lm(Sepal.Width ~ Species, data = iris)
+ estimate_contrasts(model)
+ 
+ # Dealing with interactions
+ model <- lm(Sepal.Width ~ Species * Petal.Width, data = iris)
+ 
+ # By default: selects first factor
+ estimate_contrasts(model)
+ 
+ # Can also run contrasts between points of numeric
+ estimate_contrasts(model, contrast = "Petal.Width", length = 4)
+ 
+ # Or both
+ estimate_contrasts(model, contrast = c("Species", "Petal.Width"), length = 2)
+ 
+ # Or with custom specifications
+ estimate_contrasts(model, contrast = c("Species", "Petal.Width=c(1, 2)"))
+ 
+ # Can fixate the numeric at a specific value
+ estimate_contrasts(model, fixed = "Petal.Width")
+ 
+ # Or modulate it
+ estimate_contrasts(model, at = "Petal.Width", length = 4)
+ 
+ # Standardized differences
+ estimated <- estimate_contrasts(lm(Sepal.Width ~ Species, data = iris))
+ standardize(estimated)
+ ## Don't show: 
+ }) # examplesIf
> model <- lm(Sepal.Width ~ Species, data = iris)
> estimate_contrasts(model)
No variable was specified for contrast estimation. Selecting `contrast = "Species"`.
Marginal Contrasts Analysis

Level1     |     Level2 | Difference |         95% CI |   SE | t(147) |      p
------------------------------------------------------------------------------
setosa     | versicolor |       0.66 | [ 0.49,  0.82] | 0.07 |   9.69 | < .001
setosa     |  virginica |       0.45 | [ 0.29,  0.62] | 0.07 |   6.68 | < .001
versicolor |  virginica |      -0.20 | [-0.37, -0.04] | 0.07 |  -3.00 | 0.003 

Marginal contrasts estimated at Species
p-value adjustment method: Holm (1979)> model <- lm(Sepal.Width ~ Species * Petal.Width, data = iris)
> estimate_contrasts(model)
No variable was specified for contrast estimation. Selecting `contrast = "Species"`.
NOTE: Results may be misleading due to involvement in interactions
Marginal Contrasts Analysis

Level1     |     Level2 | Difference |        95% CI |   SE | t(144) |      p
-----------------------------------------------------------------------------
setosa     | versicolor |       1.59 | [ 0.64, 2.54] | 0.39 |   4.04 | < .001
setosa     |  virginica |       1.77 | [ 0.77, 2.78] | 0.41 |   4.29 | < .001
versicolor |  virginica |       0.18 | [-0.17, 0.54] | 0.15 |   1.27 | 0.205 

Marginal contrasts estimated at Species
p-value adjustment method: Holm (1979)> estimate_contrasts(model, contrast = "Petal.Width", length = 4)
NOTE: Results may be misleading due to involvement in interactions
Marginal Contrasts Analysis

Level1         |         Level2 | Difference |         95% CI |   SE | t(144) |      p
--------------------------------------------------------------------------------------
Petal.Width0.1 | Petal.Width0.9 |      -0.67 | [-1.02, -0.33] | 0.13 |  -5.18 | < .001
Petal.Width0.1 | Petal.Width1.7 |      -1.35 | [-2.04, -0.65] | 0.26 |  -5.18 | < .001
Petal.Width0.1 | Petal.Width2.5 |      -2.02 | [-3.06, -0.98] | 0.39 |  -5.18 | < .001
Petal.Width0.9 | Petal.Width1.7 |      -0.67 | [-1.02, -0.33] | 0.13 |  -5.18 | < .001
Petal.Width0.9 | Petal.Width2.5 |      -1.35 | [-2.04, -0.65] | 0.26 |  -5.18 | < .001
Petal.Width1.7 | Petal.Width2.5 |      -0.67 | [-1.02, -0.33] | 0.13 |  -5.18 | < .001

Marginal contrasts estimated at Petal.Width
p-value adjustment method: Holm (1979)> estimate_contrasts(model, contrast = c("Species", "Petal.Width"), length = 2)
Marginal Contrasts Analysis

Level1                    |                    Level2 | Difference |         95% CI |   SE | t(144) |      p
------------------------------------------------------------------------------------------------------------
setosa Petal.Width0.1     |     setosa Petal.Width2.5 |      -2.01 | [-4.92,  0.91] | 0.98 |  -2.06 | 0.166 
setosa Petal.Width0.1     | versicolor Petal.Width0.1 |       1.83 | [ 0.99,  2.66] | 0.28 |   6.55 | < .001
setosa Petal.Width0.1     | versicolor Petal.Width2.5 |      -0.70 | [-1.50,  0.10] | 0.27 |  -2.61 | 0.059 
setosa Petal.Width0.1     |  virginica Petal.Width0.1 |       1.55 | [ 0.62,  2.48] | 0.31 |   4.95 | < .001
setosa Petal.Width0.1     |  virginica Petal.Width2.5 |       0.03 | [-0.30,  0.37] | 0.11 |   0.29 | 0.984 
setosa Petal.Width2.5     | versicolor Petal.Width2.5 |       1.31 | [-1.54,  4.16] | 0.95 |   1.37 | 0.517 
setosa Petal.Width2.5     |  virginica Petal.Width2.5 |       2.04 | [-0.71,  4.79] | 0.92 |   2.21 | 0.142 
versicolor Petal.Width0.1 |     setosa Petal.Width2.5 |      -3.84 | [-6.69, -0.98] | 0.96 |  -4.01 | < .001
versicolor Petal.Width0.1 | versicolor Petal.Width2.5 |      -2.53 | [-4.08, -0.98] | 0.52 |  -4.86 | < .001
versicolor Petal.Width0.1 |  virginica Petal.Width0.1 |      -0.28 | [-1.49,  0.93] | 0.41 |  -0.69 | 0.984 
versicolor Petal.Width0.1 |  virginica Petal.Width2.5 |      -1.80 | [-2.64, -0.95] | 0.28 |  -6.35 | < .001
versicolor Petal.Width2.5 |  virginica Petal.Width2.5 |       0.73 | [-0.08,  1.55] | 0.27 |   2.70 | 0.055 
virginica Petal.Width0.1  |     setosa Petal.Width2.5 |      -3.56 | [-6.44, -0.67] | 0.97 |  -3.68 | 0.003 
virginica Petal.Width0.1  | versicolor Petal.Width2.5 |      -2.25 | [-3.44, -1.06] | 0.40 |  -5.64 | < .001
virginica Petal.Width0.1  |  virginica Petal.Width2.5 |      -1.52 | [-2.63, -0.40] | 0.37 |  -4.04 | < .001

Marginal contrasts estimated at Species, Petal.Width
p-value adjustment method: Holm (1979)> estimate_contrasts(model, contrast = c("Species", "Petal.Width=c(1, 2)"))
Marginal Contrasts Analysis

Level1                  |                  Level2 | Difference |         95% CI |   SE | t(144) |      p
--------------------------------------------------------------------------------------------------------
setosa Petal.Width1     |     setosa Petal.Width2 |      -0.84 | [-2.05,  0.38] | 0.41 |  -2.06 | 0.166 
setosa Petal.Width1     | versicolor Petal.Width1 |       1.63 | [ 0.68,  2.59] | 0.32 |   5.09 | < .001
setosa Petal.Width1     | versicolor Petal.Width2 |       0.58 | [-0.45,  1.61] | 0.35 |   1.68 | 0.191 
setosa Petal.Width1     |  virginica Petal.Width1 |       1.73 | [ 0.68,  2.78] | 0.35 |   4.93 | < .001
setosa Petal.Width1     |  virginica Petal.Width2 |       1.10 | [ 0.17,  2.04] | 0.31 |   3.52 | 0.005 
setosa Petal.Width2     | versicolor Petal.Width2 |       1.42 | [-0.77,  3.60] | 0.73 |   1.94 | 0.166 
setosa Petal.Width2     |  virginica Petal.Width2 |       1.94 | [-0.20,  4.08] | 0.72 |   2.71 | 0.038 
versicolor Petal.Width1 |     setosa Petal.Width2 |      -2.47 | [-4.62, -0.32] | 0.72 |  -3.43 | 0.005 
versicolor Petal.Width1 | versicolor Petal.Width2 |      -1.05 | [-1.70, -0.41] | 0.22 |  -4.86 | < .001
versicolor Petal.Width1 |  virginica Petal.Width1 |       0.10 | [-0.45,  0.65] | 0.19 |   0.54 | 0.589 
versicolor Petal.Width1 |  virginica Petal.Width2 |      -0.53 | [-0.81, -0.25] | 0.09 |  -5.72 | < .001
versicolor Petal.Width2 |  virginica Petal.Width2 |       0.52 | [ 0.05,  0.99] | 0.16 |   3.31 | 0.007 
virginica Petal.Width1  |     setosa Petal.Width2 |      -2.57 | [-4.76, -0.38] | 0.73 |  -3.50 | 0.005 
virginica Petal.Width1  | versicolor Petal.Width2 |      -1.15 | [-1.83, -0.48] | 0.23 |  -5.13 | < .001
virginica Petal.Width1  |  virginica Petal.Width2 |      -0.63 | [-1.10, -0.17] | 0.16 |  -4.04 | < .001

Marginal contrasts estimated at Species, Petal.Width
p-value adjustment method: Holm (1979)> estimate_contrasts(model, fixed = "Petal.Width")
No variable was specified for contrast estimation. Selecting `contrast = "Species"`.
Marginal Contrasts Analysis

Level1     |     Level2 | Petal.Width | Difference |        95% CI |   SE | t(144) |      p
-------------------------------------------------------------------------------------------
setosa     | versicolor |        1.20 |       1.59 | [ 0.64, 2.54] | 0.39 |   4.04 | < .001
setosa     |  virginica |        1.20 |       1.77 | [ 0.77, 2.78] | 0.41 |   4.29 | < .001
versicolor |  virginica |        1.20 |       0.18 | [-0.17, 0.54] | 0.15 |   1.27 | 0.205 

Marginal contrasts estimated at Species
p-value adjustment method: Holm (1979)> estimate_contrasts(model, at = "Petal.Width", length = 4)
No variable was specified for contrast estimation. Selecting `contrast = "Species"`.
Marginal Contrasts Analysis

Level1     |     Level2 | Petal.Width | Difference |        95% CI |   SE | t(144) |      p
-------------------------------------------------------------------------------------------
setosa     | versicolor |        0.10 |       1.83 | [ 1.15, 2.50] | 0.28 |   6.55 | < .001
setosa     | versicolor |        0.90 |       1.65 | [ 0.96, 2.35] | 0.29 |   5.74 | < .001
setosa     | versicolor |        1.70 |       1.48 | [ 0.03, 2.94] | 0.60 |   2.47 | 0.015 
setosa     | versicolor |        2.50 |       1.31 | [-1.00, 3.62] | 0.95 |   1.37 | 0.172 
setosa     |  virginica |        0.10 |       1.55 | [ 0.79, 2.30] | 0.31 |   4.95 | < .001
setosa     |  virginica |        0.90 |       1.71 | [ 0.93, 2.50] | 0.32 |   5.28 | < .001
setosa     |  virginica |        1.70 |       1.88 | [ 0.43, 3.32] | 0.60 |   3.14 | 0.004 
setosa     |  virginica |        2.50 |       2.04 | [-0.19, 4.28] | 0.92 |   2.21 | 0.057 
versicolor |  virginica |        0.10 |      -0.28 | [-1.26, 0.70] | 0.41 |  -0.69 | 0.492 
versicolor |  virginica |        0.90 |       0.06 | [-0.44, 0.56] | 0.21 |   0.28 | 0.780 
versicolor |  virginica |        1.70 |       0.40 | [ 0.12, 0.67] | 0.11 |   3.50 | 0.002 
versicolor |  virginica |        2.50 |       0.73 | [ 0.08, 1.39] | 0.27 |   2.70 | 0.023 

Marginal contrasts estimated at Species
p-value adjustment method: Holm (1979)> estimated <- estimate_contrasts(lm(Sepal.Width ~ Species, data = iris))
No variable was specified for contrast estimation. Selecting `contrast = "Species"`.
> standardize(estimated)
Marginal Contrasts Analysis (standardized)

Level1     |     Level2 | Difference |         95% CI |   SE | t(147) |      p
------------------------------------------------------------------------------
setosa     | versicolor |       1.51 | [ 1.13,  1.89] | 0.16 |   9.69 | < .001
setosa     |  virginica |       1.04 | [ 0.66,  1.42] | 0.16 |   6.68 | < .001
versicolor |  virginica |      -0.47 | [-0.85, -0.09] | 0.16 |  -3.00 | 0.003 

Marginal contrasts estimated at Species
p-value adjustment method: Holm (1979)> ## End(Don't show)
> ## Don't show: 
> if (requireNamespace("lme4", quietly = TRUE)) (if (getRversion() >= "3.4") withAutoprint else force)({ # examplesIf
+ ## End(Don't show)
+ # Other models (mixed, Bayesian, ...)
+ data <- iris
+ data$Petal.Length_factor <- ifelse(data$Petal.Length < 4.2, "A", "B")
+ 
+ model <- lme4::lmer(Sepal.Width ~ Species + (1 | Petal.Length_factor), data = data)
+ estimate_contrasts(model)
+ ## Don't show: 
+ }) # examplesIf
> data <- iris
> data$Petal.Length_factor <- ifelse(data$Petal.Length < 4.2, "A", "B")
> model <- lme4::lmer(Sepal.Width ~ Species + (1 | Petal.Length_factor), 
+     data = data)
> estimate_contrasts(model)
No variable was specified for contrast estimation. Selecting `contrast = "Species"`.
Error in tcrossprod(sc * Li) : "tcrossprod" is not a BUILTIN function
Calls: <Anonymous> ... VarCorr.merMod -> structure -> mkVarCorr -> lapply -> FUN
Execution halted