Clone this wiki locally
install.packages("data.table") # install it library(data.table) # load it example(data.table) # run some examples ?data.table # read ?fread # read update.packages() # keep up to date
Install data.table development version
From a clean session (make sure data.table package isn't loaded):
remove.packages("data.table") # First remove the current version install.packages("data.table", type = "source", repos = "http://Rdatatable.github.io/data.table") # Then install devel version
If you would like to revert back to CRAN version, from a clean session, do:
remove.packages("data.table") # First remove the current version install.packages("data.table") # Then reinstall the CRAN version
If you install the latest version from GitHub and start using a new feature, you may have to keep up with updates to ensure that subsequent changes (if any) don't break your code, since it's a development version. When we release to CRAN we are saying that we are happy with the changes and (in general) you can rely on them being there in future. However, if you hit a problem that the development version fixes then it is usually safe to simply upgrade to it. If it doesn't work out, you can very easily revert back to the CRAN version by removing the package and reinstalling (see commands above). Please also tell us about any such issues you encounter.
Windows users without Rtools can still install development version of data.table by using binaries compiled during our Windows CI tests. Visit data.table on AppVeyor, click on one of two jobs (release/devel), go to artifacts tab. Copy link of
data.table_*.zip file and paste it into call below.
OpenMP enabled compiler for Mac
Mac users will also additionally need OpenMP enabled compiler, but currently El Capitan v10.11.4 comes installed with clang, which is not.
First, ensure that you have command line tools installed. Do NOT skip this step. It is essential. See https://github.com/Rdatatable/data.table/issues/1692. From the terminal, type:
If you get an error message:
xcode-select: error: command line tools are already installed, use "Software Update" to install updates, then you already have command line tools and can proceed to the next step. Else please follow the onscreen instructions and install it first.
Then, install homebrew if you have not already. After that, we can install the OpenMP enabled
clang from the terminal by typing:
# update: seems like this installs clang with openmp support, # as pointed out by @botanize in #1817 brew update && brew install llvm
Following that add these lines to the file
~/.R/Makevars using your favourite text editor. It's likely you need to create the
.R directory and the file
Makevars in it if it doesn't already exist.
CC=/usr/local/opt/llvm/bin/clang -fopenmp CXX=/usr/local/opt/llvm/bin/clang++ LDFLAGS=-L/usr/local/opt/gettext/lib -L/usr/local/opt/llvm/lib CPPFLAGS=-I/usr/local/opt/gettext/include -I/usr/local/opt/llvm/include
Save and close the file. Then you should be all set on Mac. The
-fopenmp tag on
CC line might cause compile problems for other packages, notably
stringi. Simply remove -fopenmp after compiling
Installing R via homebrew might cause additional problems during installation and is not recommended.
Why we recommend
install.packages above rather than
This way you fetch the last version pushed to master which also passed full tests on a clean instance. This protects you from pulling master if it happens to be in a broken state.
devtoolsalways pulls master even if a recent push is failing tests. To do that for some reason (e.g. if we've just pushed a fix and you can't wait 15 mins for tests to complete, or if Travis checks themselves are not running):
As from devtools v1.10.0 (Feb 2016),
install_github()checks the version number and doesn't update if the version number in master hasn't been bumped; i.e., similar to
update.packages(). However, we only update the version number on release to CRAN. Therefore with
install.packages(), you know for sure that it is fetching and installing the latest passing version from dev.