What is the difference between require() and library()?

Marco picture Marco · Apr 8, 2011 · Viewed 143.3k times · Source

What is the difference between require() and library()?

Answer

richiemorrisroe picture richiemorrisroe · Apr 8, 2011

There's not much of one in everyday work.

However, according to the documentation for both functions (accessed by putting a ? before the function name and hitting enter), require is used inside functions, as it outputs a warning and continues if the package is not found, whereas library will throw an error.