The error messages come from the packages. What's happening there (I believe) is that because of the way RMarkdown works, the rendering process has to explicitly call eval() around the code, which gives you a slightly different output.
I actually can't reprex what happens interactively, since reprex uses rmarkdown::render() under the hood. So, in reprex you get the same error message regardless of whether or not you explicitly call eval():
eval(temp <- MASS)
#> Error in eval(temp <- MASS): object 'MASS' not found
temp <- MASS
#> Error in eval(expr, envir, enclos): object 'MASS' not found
Created on 2018-10-05 by the reprex package (v0.2.1.9000)
Interactively, without running eval() you'll get the error message you have above: