What is the difference between require()
and library()
?
My initial theory about the difference was that library
loads the packages whether it is already loaded or not, i.e. it might reload an already loaded package, while require
just checks that it is loaded, or loads it if it isn't (thus the use in functions that rely on a certain package). The documentation refutes this, however, and explicitly states that neither function will reload an already loaded package.