The value of the internal evaluation of a top-level R expression is always assigned to .Last.value (in package:base) before further processing (e.g., printing).
.Last.value
# NOT RUN {
## These will not work correctly from example(),
## but they will in make check or if pasted in,
## as example() does not run them at the top level
gamma(1:15) # think of some intensive calculation...
fac14 <- .Last.value # keep them
library("splines") # returns invisibly
.Last.value # shows what library(.) above returned
# }