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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: summary
> ### Title: Methods for 'ref.grid' objects
> ### Aliases: summary summary.ref.grid str.ref.grid predict.ref.grid
> ###   print.ref.grid print.summary.ref.grid plot.lsmobj
> ###   plot.summary.ref.grid vcov.ref.grid regrid rbind rbind.ref.grid
> ###   as.mcmc as.mcmc.ref.grid as.mcmc.list as.mcmc.list.ref.grid
> ###   as.stanfit [.ref.grid xtable.ref.grid xtable.summary.ref.grid
> ###   print.xtable.lsm
> ### Keywords: models htest
> 
> ### ** Examples
> 
> require(lsmeans)
> warp.lm <- lm(breaks ~ wool * tension, data = warpbreaks)
> warp.rg <- ref.grid(warp.lm)
> str(warp.rg)
'ref.grid' object with variables:
    wool = A, B
    tension = L, M, H
> levels(warp.rg)
$wool
[1] "A" "B"

$tension
[1] "L" "M" "H"

> 
> summary(warp.rg)
 wool tension prediction       SE df
 A    L         44.55556 3.646761 48
 B    L         28.22222 3.646761 48
 A    M         24.00000 3.646761 48
 B    M         28.77778 3.646761 48
 A    H         24.55556 3.646761 48
 B    H         18.77778 3.646761 48

> 
> summary(warp.rg, by = "wool", 
+         infer = c(TRUE, FALSE), level = .90, adjust = "sidak")
wool = A:
 tension prediction       SE df lower.CL upper.CL
 L         44.55556 3.646761 48 36.62029 52.49082
 M         24.00000 3.646761 48 16.06473 31.93527
 H         24.55556 3.646761 48 16.62029 32.49082

wool = B:
 tension prediction       SE df lower.CL upper.CL
 L         28.22222 3.646761 48 20.28695 36.15749
 M         28.77778 3.646761 48 20.84251 36.71305
 H         18.77778 3.646761 48 10.84251 26.71305

Confidence level used: 0.9 
Conf-level adjustment: sidak method for 3 estimates 
> 
> # Do all pairwise comparisons within rows or within columns, 
> # all considered as one faily of tests:
> w.t <- pairs(lsmeans(warp.rg, ~ wool | tension))
> t.w <- pairs(lsmeans(warp.rg, ~ tension | wool))
> rbind(w.t, t.w)
 tension wool contrast   estimate       SE df t.ratio p.value
 L       .    A - B    16.3333333 5.157299 48   3.167  0.0241
 M       .    A - B    -4.7777778 5.157299 48  -0.926  1.0000
 H       .    A - B     5.7777778 5.157299 48   1.120  1.0000
 .       A    L - M    20.5555556 5.157299 48   3.986  0.0021
 .       A    L - H    20.0000000 5.157299 48   3.878  0.0029
 .       A    M - H    -0.5555556 5.157299 48  -0.108  1.0000
 .       B    L - M    -0.5555556 5.157299 48  -0.108  1.0000
 .       B    L - H     9.4444444 5.157299 48   1.831  0.6594
 .       B    M - H    10.0000000 5.157299 48   1.939  0.5255

P value adjustment: bonferroni method for 9 tests 
> 
> # Transformed response
> sqwarp.rg <- ref.grid(update(warp.lm, sqrt(breaks) ~ .))
> summary(sqwarp.rg)
 wool tension prediction        SE df
 A    L         6.547580 0.3266313 48
 B    L         5.238146 0.3266313 48
 A    M         4.825948 0.3266313 48
 B    M         5.298655 0.3266313 48
 A    H         4.856380 0.3266313 48
 B    H         4.302202 0.3266313 48

Results are given on the sqrt (not the response) scale. 
> 
> # Back-transformed results - compare with summary of 'warp.rg'
> summary(sqwarp.rg, type = "response")
 wool tension response       SE df
 A    L       42.87080 4.277289 48
 B    L       27.43817 3.421885 48
 A    M       23.28978 3.152612 48
 B    M       28.07575 3.461414 48
 A    H       23.58442 3.172492 48
 B    H       18.50894 2.810468 48

> 
> # But differences of sqrts can't be back-transformed
> summary(pairs(sqwarp.rg, by = "wool"), type = "response")
wool = A:
 contrast    estimate        SE df t.ratio p.value
 L - M     1.72163149 0.4619265 48   3.727  0.0015
 L - H     1.69120003 0.4619265 48   3.661  0.0018
 M - H    -0.03043145 0.4619265 48  -0.066  0.9976

wool = B:
 contrast    estimate        SE df t.ratio p.value
 L - M    -0.06050953 0.4619265 48  -0.131  0.9906
 L - H     0.93594391 0.4619265 48   2.026  0.1169
 M - H     0.99645344 0.4619265 48   2.157  0.0892

P value adjustment: tukey method for comparing a family of 3 estimates 
> 
> # We can do it via regrid
> sqwarp.rg2 <- regrid(sqwarp.rg)
> summary(sqwarp.rg2)  # same as for sqwarp.rg with type = "response"
 wool tension response       SE df
 A    L       42.87080 4.277289 48
 B    L       27.43817 3.421885 48
 A    M       23.28978 3.152612 48
 B    M       28.07575 3.461414 48
 A    H       23.58442 3.172492 48
 B    H       18.50894 2.810468 48

> pairs(sqwarp.rg2, by = "wool")
wool = A:
 contrast   estimate       SE df t.ratio p.value
 L - M    19.5810240 5.313583 48   3.685  0.0017
 L - H    19.2863767 5.325402 48   3.622  0.0020
 M - H    -0.2946473 4.472546 48  -0.066  0.9976

wool = B:
 contrast   estimate       SE df t.ratio p.value
 L - M    -0.6375769 4.867308 48  -0.131  0.9906
 L - H     8.9292303 4.428095 48   2.016  0.1192
 M - H     9.5668072 4.458712 48   2.146  0.0914

P value adjustment: tukey method for comparing a family of 3 estimates 
> 
> # Logistic regression
> # Reshape the Titanic data
> Titan <- do.call("expand.grid", dimnames(Titanic)[-4])
> Titan$Died <- matrix(Titanic, ncol=2)
> Titan.glm <- glm(Died ~ (Class + Sex + Age)^2, 
+     family = binomial, data = Titan)
> Titan.lsm <- lsmeans(Titan.glm, ~ Class|Sex, at = list(Age="Adult"))
> summary(Titan.lsm, type="response")
Error in X[ii, ii, drop = FALSE] %*% y[ii] : non-conformable arguments
Calls: summary ... summary.ref.grid -> .est.se.df -> t -> apply -> FUN -> .qf.non0
Execution halted