Go to TogaWare.com Home Page. Data Science Desktop Survival Guide
by Graham Williams
Duck Duck Go



CLICK HERE TO VISIT THE UPDATED SURVIVAL GUIDE

Packages and Libraries

REVIEW The power of the R ecosystem comes from the ability to extend the language by its nature as open source software. Anyone is able to contribute to the R ecosystem and by following stringent guidelines they can have their contributions included in the comprehensive R archive network, abbreviated as CRAN3.1. Such contributions are collected by an author into what is called a package. Over the decades many researchers and developers have contributed very many packages to CRAN. A package is how R collects together commands for a specific collection of tasks. A command is a verb in the computer language used to tell the computer to do something. There are over 16,000 packages available for R from almost as many different authors. Hence there are very many verbs available to build our sentences to command R appropriately. With so many packages there is bound to be a package or two covering essentially any kind of processing we could imagine though we will also find packages offering the same or similar commands (verbs) perhaps even with very different meanings. Most chapters will list at the beginning of the chapter the R packages that are required for us to be able to replicate the examples presented in that chapter. Packages are installed from the Internet (from the securely managed https://cran.r-project.orgCRAN package repository) into a local library on our own computer. A library is a folder on our computer's storage which contains sub-folders corresponding to each of the installed packages. To install a package from the Internet we can use the command install.packages() and provide to it as an argument the name of the package to install. The package name is provided as a string of characters within quotes and supplied as the pkgs= argument to the command as in the following code. Here we choose to install a package called dplyr—a very useful package for data manipulations.
# Install a package from a CRAN repository.

install.packages(pkgs="dplyr")

Once a package is installed we can access the commands provided by that package by prefixing the command name with the package name as in ggplot2::qplot(). This is to say that qplot() is provided by the ggplot2 package.


Support further development by purchasing the PDF version of the book.
Other online resources include the GNU/Linux Desktop Survival Guide.
Books available on Amazon include Data Mining with Rattle and Essentials of Data Science.
Popular open source software includes rattle and wajig.
Hosted by Togaware, a pioneer of free and open source software since 1984.
Copyright © 2000-2020 Togaware Pty Ltd. . Creative Commons ShareAlike V4.