[R] How to program with colleagues

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Tue Apr 19 19:51:17 CEST 2011


On Tue, Apr 19, 2011 at 6:20 PM, Alaios <alaios at yahoo.com> wrote:

> b. Could you please suggest me an easy way to exchange the R code with my colleagues. I know about these version systems but unfortunately they look pretty bizarre to me.

 Nothing looks more bizarre than a project that isn't using version
control. You end up with files like 'modelfit-daves-version.R',
'workedOnThursday.R', and 'daves-version-worked-on-Thrusday-0022.R'.

 Use Mercurial ("hg"), and force the team to use it. Only through
force will the team realise it is a Good Thing. You can get private
hosting for Mercurial on BitBucket for a small number of
people/projects. If your code is open you can have as many projects as
you like. Or you can pay for hosting.

 You may also want to decide on coding style (so that Fred isn't
continually re-indenting Dave's code with three spaces instead of
four). If you are developing a package the most of the directory
structure is decided for you, but you might also want to use Roxygen
for documentation.

 The important thing is to get it right at the start, since it can be
a pain to implement many best practices after the team has been doing
it wrong for a while.

 And obviously +1 for writing tests, and use git if anyone prefers it to hg.

Barry



More information about the R-help mailing list