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

> library(rtf)

> output <- "rtf_vignette.doc"

> rtf <- RTF(output, width = 8.5, height = 11, font.size = 10, 
+     omi = c(1, 1, 1, 1))

> done(rtf)

> addHeader(rtf, title = "Section Header", subtitle = "This is the subheading or section text.")

> addParagraph(rtf, "This is a new self-contained paragraph.\n")

> startParagraph(rtf)

> addText(rtf, "This text was added with the addText command.  ")

> addText(rtf, "You can add styled text too.  ", bold = TRUE, 
+     italic = TRUE)

> addText(rtf, "You must end the paragraph manually.")

> endParagraph(rtf)

> addNewLine(rtf)

> addParagraph(rtf, "&Alpha; &Beta; &Gamma; &Delta; &Epsilon;\n\n")

> addParagraph(rtf, "&alpha; &beta; &gamma; &delta; &epsilon;\n\n")

> addParagraph(rtf, "\\u9829\\3 \\u9829\\3 \\u9829\\3\n\n")

> addParagraph(rtf, "Normal, \\b this is bold\\b0, normal.\n")

> addParagraph(rtf, "Normal, {\\b\\i bold-italic}, normal.\n")

> tab <- as.data.frame(head(iris))

> colnames(tab) <- gsub("\\.", " ", colnames(tab))

> library(xtable)

> print(xtable(tab), table.placement = "!htbp")
% latex table generated in R 4.2.0 by xtable 1.8-4 package
% Thu Aug  5 02:37:22 2021
\begin{table}[!htbp]
\centering
\begin{tabular}{rrrrrl}
  \hline
 & Sepal Length & Sepal Width & Petal Length & Petal Width & Species \\ 
  \hline
1 & 5.10 & 3.50 & 1.40 & 0.20 & setosa \\ 
  2 & 4.90 & 3.00 & 1.40 & 0.20 & setosa \\ 
  3 & 4.70 & 3.20 & 1.30 & 0.20 & setosa \\ 
  4 & 4.60 & 3.10 & 1.50 & 0.20 & setosa \\ 
  5 & 5.00 & 3.60 & 1.40 & 0.20 & setosa \\ 
  6 & 5.40 & 3.90 & 1.70 & 0.40 & setosa \\ 
   \hline
\end{tabular}
\end{table}

> addTable(rtf, tab, font.size = 9, row.names = FALSE, 
+     NA.string = "-")

> tab <- table(iris$Species, floor(iris$Sepal.Length))

> names(dimnames(tab)) <- c("Species", "Sepal Length")

> print(xtable(tab), table.placement = "!htbp")
% latex table generated in R 4.2.0 by xtable 1.8-4 package
% Thu Aug  5 02:37:22 2021
\begin{table}[!htbp]
\centering
\begin{tabular}{rrrrr}
  \hline
 & 4 & 5 & 6 & 7 \\ 
  \hline
setosa &  20 &  30 &   0 &   0 \\ 
  versicolor &   1 &  25 &  23 &   1 \\ 
  virginica &   1 &   6 &  31 &  12 \\ 
   \hline
\end{tabular}
\end{table}

> addTable(rtf, tab, font.size = 10, row.names = TRUE, 
+     NA.string = "-", col.widths = c(1, 0.5, 0.5, 0.5, 0.5))

> plot(iris[, 1], iris[, 2])

> addPlot(rtf, plot.fun = plot, width = 6, height = 6, 
+     res = 300, iris[, 1], iris[, 2])

> newPlot <- function() {
+     par(pty = "s", cex = 0.7)
+     plot(iris[, 1], iris[, 2])
+     abline(h = 2.5, v = 6, lty = 2)
+ }

> newPlot()

> addPlot(rtf, plot.fun = newPlot, width = 6, height = 6, 
+     res = 300)

> library(lattice)

> p <- histogram(~height | voice.part, data = singer, 
+     xlab = "Height")

> print(p)

> addPlot(rtf, plot.fun = print, width = 5, height = 5, 
+     res = 300, p)

> p2 <- densityplot(~height | voice.part, data = singer, 
+     xlab = "Height")

> print(p2)

> addTrellisObject(rtf, trellis.object = p2, width = 5, 
+     height = 5, res = 300)

> p3 <- xyplot(uptake ~ conc | Plant, CO2, layout = c(2, 
+     2))

> print(p3)

> addTrellisObject(rtf, trellis.object = p3, width = 6, 
+     height = 6, res = 300)

> library(ggplot2)

  When sourcing 'rtf.R':
Error: there is no package called 'ggplot2'
Execution halted

  'rtf.Rnw'... failed