Errors in running code in vignettes:
when running code in 'Ch_missing_values.Rnw'

> rm(list = ls())

> s <- search()[-1]

> s <- s[-match(c("package:base", "package:stats", "package:graphics", 
+     "package:grDevices", "package:utils", "package:datasets", 
+     "packag ..." ... [TRUNCATED] 

> if (length(s) > 0) sapply(s, detach, character.only = TRUE)

> if (!file.exists("tables")) dir.create("tables")

> if (!file.exists("figures")) dir.create("figures")

> set.seed(290875)

> options(prompt = "R> ", continue = "+  ", width = 63, 
+     show.signif.stars = FALSE, SweaveHooks = list(leftpar = function() par(mai = par("mai") .... [TRUNCATED] 

> HSAURpkg <- require("HSAUR3")
Loading required package: HSAUR3
Loading required package: tools

> if (!HSAURpkg) stop("cannot load package ", sQuote("HSAUR3"))

> rm(HSAURpkg)

> a <- Sys.setlocale("LC_ALL", "C")

> book <- TRUE

> refs <- cbind(c("AItR", "DAGD", "SI", "CI", "ANOVA", 
+     "MLR", "GLM", "DE", "RP", "GAM", "SA", "ALDI", "ALDII", "SIMC", 
+     "MA", "PCA", "MDS ..." ... [TRUNCATED] 

> ch <- function(x) {
+     ch <- refs[which(refs[, 1] == x), ]
+     if (book) {
+         return(paste("Chapter~\\\\ref{", ch[1], "}", sep = ""))
+  .... [TRUNCATED] 

> if (file.exists("deparse.R")) source("deparse.R")

> setHook(packageEvent("lattice", "attach"), function(...) {
+     lattice.options(default.theme = function() standard.theme("pdf", 
+         color = .... [TRUNCATED] 

> book <- FALSE

> data("bp", package = "HSAUR3")

> toLatex(HSAURtable(bp), pcol = 2, caption = paste("Blood pressure data."), 
+     label = "MV-bp-tab")
\index{bp data@\Robject{bp} data}
\begin{center}
\begin{longtable}{ rrr|rrr }
\caption{\Robject{bp} data. Blood pressure data. \label{MV-bp-tab}}
\\
\hline
\Robject{logdose} & \Robject{bloodp} & \Robject{recovtime} & \Robject{logdose} & \Robject{bloodp} & \Robject{recovtime} \\ \hline
\endfirsthead
\caption[]{\Robject{bp} data (continued).} \\
\hline
\Robject{logdose} & \Robject{bloodp} & \Robject{recovtime} & \Robject{logdose} & \Robject{bloodp} & \Robject{recovtime} \\ \hline
\endhead
2.26 & 66 & 7 & 2.70 & 73 & 39 \\
1.81 & 52 & 10 & 1.90 & 56 & 28 \\
1.78 & 72 & 18 & 2.78 & 83 & 12 \\
1.54 & 67 & NA & 2.27 & 67 & 60 \\
2.06 & 69 & 10 & 1.74 & 84 & 10 \\
1.74 & 71 & 13 & 2.62 & 68 & NA \\
2.56 & 88 & 21 & 1.80 & 64 & 22 \\
2.29 & 68 & 12 & 1.81 & 60 & 21 \\
1.80 & 59 & 9 & 1.58 & 62 & 14 \\
2.32 & 73 & NA & 2.41 & 76 & 4 \\
2.04 & 68 & 20 & 1.65 & 60 & 27 \\
1.88 & 58 & 31 & 2.24 & 60 & 26 \\
1.18 & 61 & 23 & 1.70 & 59 & NA \\
2.08 & 68 & 22 & 2.45 & 84 & 15 \\
1.70 & 69 & 13 & 1.72 & 66 & 8 \\
1.74 & 55 & 9 & 2.37 & 68 & 46 \\
1.90 & 67 & 50 & 2.23 & 65 & 24 \\
1.79 & 67 & NA & 1.92 & 69 & NA \\
2.11 & 68 & 11 & 1.99 & 72 & 25 \\
1.72 & 59 & 8 & 1.99 & 63 & 45 \\
1.74 & 68 & NA & 2.35 & 56 & 72 \\
1.60 & 63 & 16 & 1.80 & 70 & 25 \\
2.15 & 65 & 23 & 2.36 & 69 & 28 \\
2.26 & 72 & 7 & 1.59 & 60 & 10 \\
1.65 & 58 & NA & 2.10 & 51 & 25 \\
1.63 & 69 & NA & 1.80 & 61 & 44 \\
2.40 & 70 & NA &   &   &   \\
\hline
\end{longtable}
\end{center}

> sapply(bp, function(x) sum(is.na(x)))
  logdose    bloodp recovtime 
        0         0        10 

> summary(bp$recovtime, na.rm = TRUE)
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
    4.0    10.5    21.0    22.4    26.5    72.0      10 

> sd(bp$recovtime, na.rm = TRUE)
[1] 15.08727

> with(bp, cor(bloodp, recovtime, use = "complete.obs"))
[1] -0.1888398

> with(bp, cor(logdose, recovtime, use = "complete.obs"))
[1] 0.2103542

> layout(matrix(1:3, nrow = 1))

> plot(bloodp ~ logdose, data = bp)

> plot(recovtime ~ bloodp, data = bp)

> plot(recovtime ~ logdose, data = bp)

> summary(lm(recovtime ~ bloodp + logdose, data = bp))

Call:
lm(formula = recovtime ~ bloodp + logdose, data = bp)

Residuals:
    Min      1Q  Median      3Q     Max 
-20.057 -10.487  -1.770   5.924  36.462 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)
(Intercept)  32.3099    18.4140   1.755   0.0870
bloodp       -0.6882     0.3014  -2.283   0.0278
logdose      17.7734     7.4974   2.371   0.0227

Residual standard error: 14.22 on 40 degrees of freedom
  (10 observations deleted due to missingness)
Multiple R-squared:  0.1545,	Adjusted R-squared:  0.1122 
F-statistic: 3.653 on 2 and 40 DF,  p-value: 0.03489


> library("mice")

  When sourcing 'Ch_missing_values.R':
Error: there is no package called 'mice'
Execution halted

  'Ch_analysing_longitudinal_dataI.Rnw' using 'UTF-8'... OK
  'Ch_analysing_longitudinal_dataII.Rnw' using 'UTF-8'... OK
  'Ch_analysis_of_variance.Rnw' using 'UTF-8'... OK
  'Ch_bayesian_inference.Rnw' using 'UTF-8'... OK
  'Ch_cluster_analysis.Rnw' using 'UTF-8'... OK
  'Ch_conditional_inference.Rnw' using 'UTF-8'... OK
  'Ch_density_estimation.Rnw' using 'UTF-8'... OK
  'Ch_errata.Rnw' using 'UTF-8'... OK
  'Ch_gam.Rnw' using 'UTF-8'... OK
  'Ch_graphical_display.Rnw' using 'UTF-8'... OK
  'Ch_introduction_to_R.Rnw' using 'UTF-8'... OK
  'Ch_logistic_regression_glm.Rnw' using 'UTF-8'... OK
  'Ch_meta_analysis.Rnw' using 'UTF-8'... OK
  'Ch_missing_values.Rnw' using 'UTF-8'... failed
  'Ch_multidimensional_scaling.Rnw' using 'UTF-8'... OK
  'Ch_multiple_linear_regression.Rnw' using 'UTF-8'... OK
  'Ch_principal_components_analysis.Rnw' using 'UTF-8'... OK
  'Ch_quantile_regression.Rnw' using 'UTF-8'... OK
  'Ch_recursive_partitioning.Rnw' using 'UTF-8'... OK
  'Ch_simple_inference.Rnw' using 'UTF-8'... OK
  'Ch_simultaneous_inference.Rnw' using 'UTF-8'... OK
  'Ch_survival_analysis.Rnw' using 'UTF-8'... OK