These examples explore the word counts of published Star Trek novels from 1967 through 2017 based on the stBooks dataset.

First, load packages to assist with data manipulation and plotting.

library(dplyr)
library(lubridate)
library(ggplot2)
library(ggrepel)
library(gridExtra)
library(rtrek) # use >= v0.2.1 for more accurate word count data

Look for trends in word count through time for select series: The Next Generation, Deep Space Nine, and Voyager. Mutating the date and nword columns facilitates a better plot. Retain outliers in general, but drop any titles containing the word “Omnibus” because these are known to be larger books containing multiple individual novels. Inspect the data.

Create a plot, separating each series in a different panel rather than using color to differentiate them.

Look at the marginal change through time in average word count (pool all three series) with a simple linear model.

There is about a 40% increase in average word count per novel across the three series from the the first TNG novel in 1987 through 2017. In the case of the Voyager novels, however, the average word count approximately doubles and does so over a short production run. It is worth noting that as word count has trended upward noticeably, novels from these series have also been published less frequently. If you have read many of these book in paperback form, both the oldest and the more recent ones, this should not be a surprising result. Many of the newer releases have notably more pages and smaller font than the novels from the earlier years.

In this next example, consider all books from all series available in stBooks, with the exception of Omnibus editions and those falling into the reference category. This example looks at cumulative total word count over time for all the selected books. For plot labeling purposes, this time divide the word count by one million.

The plot will be labeled with series abbreviations, so a key is needed for clarity. In order to label points on the plot marking the onset of a new novel series, take the first entry in the data frame for each series. A bit of theme customization is required for the table grid object that will display the key as an inset figure.

Finally, create the plot.

The golden age of licensed Star Trek novel publishing is clear. The 1990s and 2000s saw the creation of many new series as well of regular publication of new novels from existing ones. The current trajectory appears similar to the early 1990s, at least in terms of total words written.