Linux Format

ABOUT R PACKAGES

-

Although R is a very capable programmin­g language, it can be enhanced using code from other sources. R uses the term Packages to describe R code that gives you extra functional­ity.

There are two ways of installing an R package. If the package is available on CRAN (The Comprehens­ive R Archive Network), then you can install it using the install.packages() function. Otherwise, you should download it on your Linux machine before installing it using the same install.packages() function, but with different parameters. If you execute the library() function without any arguments, you will get a list of all installed packages. To get a more detailed output of all the installed R packages, you can also use the installed.packages() command. The update.packages() command will try to update all installed CRAN packages to the latest version.

Some of the most famous R packages are: ggplot2 (https:// ggplot2.tidyverse.org), which can help you create impressive plots;

lubridate, which help you work with dates and times; ggcal (https:// github.com/jayjacobs/ggcal), which is used in this tutorial for creating calendars; and dplyr, which is for working with data framelike objects. Additional­ly, there is tidyverse (www.tidyverse.org), which is a collection of R packages designed for data science that also includes ggplot2.

Figure 6 (see below) shows part of the output of install.packages(). Note that when using a Docker image, all packages are being installed in that running container and will be lost the next time you restart it.

Newspapers in English

Newspapers from Australia