Understanding the namespaces of a package

Another important file is the NAMESPACE file. The content of this file, and the context of namespaces in R packages itself, is a more advanced topic. It does not matter that much when we develop packages for our own use. But we should pay attention to it when we want to distribute our packages to a broader audience.

There are many packages available for R and these packages include even more functions. So it is surely possible that some packages include functions with the same name. And if we have loaded both packages, R does not know which of these packages we mean with this function function call and will take the one from the package that was loaded last.

When we create our empty package project with ...

Get Mastering RStudio – Develop, Communicate, and Collaborate with R now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.