Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use git in R package development?

Tags:

git

r

cran

I'm new to R and have started writing a medium-size project. Even though it will be distributed as part of an application, I've decided to make a package out of it to make the organisation neater.

How do I handle the fact that the DESCRIPTION file needs Version and Date fields, when I'm using version control? I wouldn't want to change that file with every git commit.

Is there a standard Makefile somewhere for this?

Further, I'm not completely clear on how I'd do this and still be able to use the package while developing.

like image 433
Andreas Avatar asked Nov 17 '12 12:11

Andreas


People also ask

Can you use Git with R?

Installation: To get started you need the following software installed on your computer: Git and if you are new to R, then you also need to install R and RStudio. Additionally you will also need a GitHub account. Git (Download Git): Download and install Git, making a note of where on your computer you are install it.


1 Answers

If you use the devtools package you don't have to build and install your package after each edit - just use load_all() and the job is done in your working session, so you can test your changes (ideally with the testthat package).

I wrote an RPub about it: http://www.rpubs.com/geospacedman/lazydevtools

You still get the option to build a package source tarball for distribution.

Note that git doesn't promote a mechanism for automatically updating bits of files with every commit, like the $id$ thing in SVN. Linus himself said it was 'idiotic' and 'stupid':

http://www.gelato.unsw.edu.au/archives/git/0610/28891.html

like image 84
Spacedman Avatar answered Oct 29 '22 00:10

Spacedman