Install the stable release from CRAN:
install.packages("data.table")
Or the development version from github:
install.packages("data.table", type = "source",
repos = "http://Rdatatable.github.io/data.table")
To revert from devel to CRAN, the current version must first be removed:
remove.packages("data.table")
install.packages("data.table")
Visit the website for full installation instructions and the latest version numbers.
Usually you will want to load the package and all of its functions with a line like
library(data.table)
If you only need one or two functions, you can refer to them like data.table::fread
instead.