Plots

Andreas Brandmaier

2026-12-04

Plot

Note that base R plots typically produce graphical output directly to the current graphics device, without assigning the result to a variable. By design, the reproducibleRchunks package only tracks metadata for variables that are explicitly created within each code chunk. Since standard plotting commands do not involve variable assignment, their output is not checked for reproducibility. See the following example, in which only the newly declared variables x and y are subject to a reproducibility check but not the plot:

x <- seq(1,10,.1)
y <- sin(x)
plot(x,y)
Click here for the Code Chunk Reproduction Report
  • ❌Reproduction error! Variable x was not defined in this chunk!

  • ❌Reproduction error! Variable y was not defined in this chunk!

Note that there is the function recordPlot() which records the plot from a graphics device. However the result object contains system-specific information such as local paths to R’s, internal libraries and the R version used or a process id, which makes reproducibility checks on plots of base R futile. Instead, we recommend reproducibility checks on the variables that contain the data that is plotted.