DEV Community

Gabor Szabo
Gabor Szabo

Posted on • Originally published at code-maven.com

Local development environment for the data.table R project

After the partial success with the development environment for R-yaml we tried another R package called data.table as part of the Open Source Development Course. Eventually we managed to run the tests of this too.

This one actually had a lot of details in the README, but some parts were still missing, or at least were assumed to be obvious, which was not the case for us.

Clone the repo

git clone git@github.com:Rdatatable/data.table.git
cd data.table
Enter fullscreen mode Exit fullscreen mode

Start Docker container

docker run -it --name data-table --workdir /opt -v$(pwd):/opt r-base:4.2.3 bash
Enter fullscreen mode Exit fullscreen mode

Install external dependencies we'll need

apt-get update
apt-get install -y pandoc curl libcurl4-gnutls-dev texlive-latex-base texlive-fonts-extra texlive-latex-recommended texlive-fonts-recommended
Enter fullscreen mode Exit fullscreen mode

Install R packages

Rscript -e 'install.packages(c("knitr", "rmarkdown", "pandoc", "curl", "bit64", "bit", "xts", "nanotime", "zoo", "R.utils", "markdown"))'
Enter fullscreen mode Exit fullscreen mode

Run the build

R CMD build .
Enter fullscreen mode Exit fullscreen mode

Run check on the generated file

In the README they mention data.table_1.11.5.tar.gz, but probably due to a change in the version number, now we have data.table_1.14.9.tar.gz

We can run this

R CMD check data.table_1.14.9.tar.gz
Enter fullscreen mode Exit fullscreen mode

But if the README is updated with this then it will be out of date soon. Instead there could be an explanation that one needs to look at the generated file.
Alternatively this command would pick up the current file, assuming there is only one of them.

R CMD check $(ls -1 data.table_*)
Enter fullscreen mode Exit fullscreen mode

Exit the Docker container

exit
Enter fullscreen mode Exit fullscreen mode

Restart the Docker container

docker container start -i data-table
Enter fullscreen mode Exit fullscreen mode

Remove Docker container

docker rm data-table
Enter fullscreen mode Exit fullscreen mode

Top comments (0)