The special variable .Last.value
holds the value of the most recent expression at the command line.
veryLongRunningFunction() # Oops! Forgot to save result x <- .Last.value # Save it now
Careful: .Last.value
is overwritten with every new expression you type, so use it immediately!