There are different R packages that provide users with general-purpose functions and specific techniques. This chapter introduces two powerful general purpose packages: data.table
and plyr
.
Some packages are already installed in the basic version of R. However, in order to use data.table
and plyr
, we need to download them from the official CRAN repository using install.packages
. Let's start with data.table
, which is a package that provides additional tools used to deal with data frames:
install.packages('data.table')
If the command doesn't work, you can specify the repository:
install.packages( pkgs = 'data.table', repos = 'http://cran.us.r-project.org' )
After installing the package, we need to load it in order to use its functions. Unfortunately, R will import all the functions from the package without using a namespace, and sometimes there might be name conflicts across different packages:
library(data.table)
The package contains a new class called data.table
, which...