Getting Organized—Libraries and Working Directories

Learn how to set up code in R, extend R’s functionality by loading packages from CRAN, and set up a working directory.

By installing packages from CRAN, we can do everything from loading data directly from different sources to doing complex statistical analysis. We can create complex and exciting plots, maps, and animations, and even do machine learning.

In this lesson, we won’t discuss how to do all those things, but we’ll get familiar with how to work with packages in general, specifically:

  • Where to find them
  • How to install and load them
  • How to get help specific to a package

An R package is a set of functions that are developed and grouped together. For those who’re familiar with a more general-purpose programming language, they would be the equivalent of libraries in other languages. Each package we install in R will extend its capabilities along a particular theme by providing a suite of associated pre-built functions. Those functions are generic, so we can use them in our code without editing them. They will be directly applicable to our code.

Get hands-on with 1400+ tech skills courses.