Skip to contents

Base R’s time-series and model-diagnostic charts have no ggplot2 equivalent, so maidr reads each by mapping it onto a layer type it already knows: a correlogram becomes a lollipop walked lag by lag, a periodogram or seasonal subseries a line, a lag plot or Q-Q plot a point layer, and the Left and Right arrow keys and sonification then work exactly as they do for those types. Every reading on this page is an experimental plot type (see “Experimental Plot Types” in the README): none has been through a user study and each may change without a deprecation period. The examples hub lists every other plot family.

Note: Everything below is Base R, so no ggplot2 counterpart is shown. Each section names the reading its chart gets, because the mapping is not always the one the chart’s name suggests: a correlogram is read as a lollipop, a cumulative periodogram as a step.

Correlogram [experimental]

acf(), pacf() and ccf() draw a spike per lag, and maidr reads each as a lollipop: one term per lag, carrying the correlation at that lag. The axes come from the function itself, so the reading says Lag against ACF, Partial ACF or CCF without being told.

acf() starts at lag 0, whose autocorrelation is always exactly 1, so the first term of an ACF is a constant rather than a measurement. pacf() has no lag 0 and starts at lag 1.

acf(lh, lag.max = 5, main = "Luteinizing hormone: autocorrelation")
012345-0.20.00.20.40.60.81.0LagACFLuteinizing hormone: autocorrelation
pacf(lh, lag.max = 5, main = "Luteinizing hormone: partial autocorrelation")
12345-0.20.00.20.40.6LagPartial ACFLuteinizing hormone: partial autocorrelation

ccf() correlates two series across negative and positive lags, so its terms are signed and the sign says which series leads.

ccf(mdeaths, fdeaths, lag.max = 4, main = "Male vs female deaths")
-0.3-0.2-0.10.00.10.20.3-0.40.00.20.40.60.81.0LagACFMale vs female deaths

Spectral Density [experimental]

spectrum() estimates how a series’ variance is distributed across frequencies. maidr reads the periodogram as a line of spectrum against frequency.

spectrum(lh, main = "Luteinizing hormone: spectral density")
0.10.20.30.40.50.010.050.200.50frequencyspectrumLuteinizing hormone: spectral densitybandwidth = 0.00601

Cumulative Periodogram [experimental]

cpgram() draws the cumulative periodogram against its confidence band. The cumulative curve is read as a step; the band is drawing rather than data, and is not announced.

Note: cpgram() labels only its x axis, so the reading carries frequency and no y label. It takes no ylab argument to supply one.

cpgram(lh, main = "Luteinizing hormone: cumulative periodogram")
0.00.10.20.30.40.50.00.20.40.60.81.0frequencyLuteinizing hormone: cumulative periodogram

Seasonal Subseries [experimental]

monthplot() breaks a seasonal series into one segment per cycle position, so every January sits together and the seasonal shape is read directly. maidr reads it as a line.

Note: monthplot() has no default for xlab – the axis it writes carries the cycle labels, not a quantity – so x is named only when the call names it. Left out, y falls back to the series name — nottem here.

monthplot(
  nottem,
  xlab = "Month", ylab = "Temperature (F)",
  main = "Nottingham temperatures by month"
)
Nottingham temperatures by monthMonthTemperature (F)JFMAMJJASOND3035404550556065

Lag Plot [experimental]

lag.plot() plots a series against itself shifted by k, which is how serial dependence is read by eye. maidr reads it as a point layer whose x axis is named for the shift — lag 1 against the series.

lag.plot(lh, lags = 1, main = "Luteinizing hormone against its own lag")
12341.52.02.53.03.5Luteinizing hormone against its own laglag 1lh1234567891011121314151617181920212223242526272829303132333435363738394041424344454647

Partial Effects [experimental]

termplot() draws each term’s fitted contribution against its own predictor, holding the rest fixed. maidr reads each panel as a line, labelled partial for <term> so the reading says it is a contribution rather than a fitted value.

termplot(lm(mpg ~ wt, data = mtcars), main = "Partial effect of weight")
2345-10-505Partial effect of weightwtPartial for wt

Q-Q Plot [experimental]

qqnorm() plots sample quantiles against theoretical ones, and qqline() adds the reference line through the quartiles. Both are read — the points as a point layer and the reference as a line — so the line a sighted reader compares against is navigable rather than decoration.

z <- rnorm(50)
qqnorm(z, main = "Normal Q-Q plot")
qqline(z)
-2-1012-2-1012Normal Q-Q plotTheoretical QuantilesSample Quantiles