Book Image

Mastering RStudio: Develop, Communicate, and Collaborate with R

4 (1)
Book Image

Mastering RStudio: Develop, Communicate, and Collaborate with R

4 (1)

Overview of this book

RStudio helps you to manage small to large projects by giving you a multi-functional integrated development environment, combined with the power and flexibility of the R programming language, which is becoming the bridge language of data science for developers and analyst worldwide. Mastering the use of RStudio will help you to solve real-world data problems. This book begins by guiding you through the installation of RStudio and explaining the user interface step by step. From there, the next logical step is to use this knowledge to improve your data analysis workflow. We will do this by building up our toolbox to create interactive reports and graphs or even web applications with Shiny. To collaborate with others, we will explore how to use Git and GitHub and how to build your own packages to ensure top quality results. Finally, we put it all together in an interactive dashboard written with R.
Table of Contents (17 chapters)
Mastering RStudio – Develop, Communicate, and Collaborate with R
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Index

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 RStudio, the NAMEPSACES file will contain the following line:

exportPattern("^[[:alpha:]]+")

This makes every function in the package available in the global environment, when the package is loaded, that does not start with a single period. This can be...