From b.rowlingson at lancaster.ac.uk  Mon May 31 10:41:37 2010
From: b.rowlingson at lancaster.ac.uk (Barry Rowlingson)
Date: Mon, 31 May 2010 09:41:37 +0100
Subject: [Rd] require( "foo (>= 2.1)" )
In-Reply-To: <4C029770.2070707@r-enthusiasts.com>
References: <4BFFFCA2.60201@r-enthusiasts.com> <4C025EBC.804@embl.de>
	<4C029770.2070707@r-enthusiasts.com>
Message-ID: <AANLkTikymtVD6zL7re88rCO8JMA3xDZv8e8AkqrrvZJi@mail.gmail.com>

On Sun, May 30, 2010 at 5:50 PM, Romain Francois
<romain at r-enthusiasts.com> wrote:
> Hi,
>
> Sure. I could and I would provide a patch. Since this is more of a "nice to
> have", I wanted to first find out whether others would find it useful, and
> also if such a patch would have chances to get accepted by one of R-core
> members.
>
> Sometimes patches I or others provide upfront are not accepted. I'm not
> complaining about it, it is always an opportunity to learn something ...
>

 For starters you could write a function called "requireVersion" that
does what you want. That would help you (since you say you often find
yourself using this paradigm) and also it would help anyone else who
does this. And since it wouldn't be a patch to R it wouldn't need
R-gods to approve it. It would also make you think about how you'd
parameterise the call - I wouldn't want to build something that had to
parse "foo (>=2.1)", for example, but having a minimum.version
argument makes more sense. Shouldn't be that difficult, you've written
most of it already!

 It might then get included in one of the packages of miscellany on
CRAN, and then maybe become core R functionality (if you sacrifice the
required animal to the R-gods, of course).

Barry



[Rd] require( "foo (>= 2.1)" )
Barry Rowlingson