Re: [Rd] Call function only when running via R CMD check?

From: Renaud <renaud_at_mancala.cbio.uct.ac.za>
Date: Tue, 18 Dec 2012 14:47:53 +0200

Many thanks for your replies.

I had a quick look at both functions:
- CRAN(): it detects timing check from --as-cran. - queryRCmdCheck() allows to detect which part of the check is calling a function (examples, tests?).

Both are useful!
Would be nice to have a R-base function which can provide a definite identification of R CMD check and other special calls (e.g. in \Sexpr in Rd files).

Bests,
Renaud

2012/12/18 Spencer Graves <spencer.graves_at_prodsyse.com>

> Have you considered the CRAN function in "fda"? Spencer
>
>
>
> On 12/18/2012 4:00 AM, Henrik Bengtsson wrote:
>
>> Hi Renaud,
>>
>> On Tue, Dec 18, 2012 at 8:44 AM, Renaud Gaujoux <renaud_at_cbio.uct.ac.za>
>> wrote:
>>
>>> Hi Henrik (and list),
>>>
>>> I am interested in a similar feature, and would be happy to see the
>>> suggestions you got off-line :)
>>> Have you come up with a robust solution, which would work in a variety of
>>> situations (in examples, tests, \Sexpr calls, etc..)?
>>>
>> see queryRCmdCheck() of R.utils. Example:
>>
>> # Get the 'R CMD check' status, if any
>> status <- R.utils::queryRCmdCheck()
>>
>> if (status != "notRunning") {
>> cat("The current R session was launched by R CMD check. Status:",
>> status, "\n")
>> } else {
>> cat("The current R session was not launched by R CMD check.\n")
>> }
>>
>> I haven't tested it with Sweave, but with examples and tests.
>>
>> R.utils 1.18.0 is on CRAN, but you'd want 1.18.3, because:
>>
>> Version: 1.18.3 [2012-11-06]
>> o BUG FIX: queryRCmdCheck() did not detect "tests" evidences when
>> 'R CMD check' was testing multiple architectures.
>>
>> It may be another couple of weeks before I submit it to CRAN, but in
>> the meanwhile you can grab it via:
>>
>> source("http://aroma-project.**org/hbLite.R<http://aroma-project.org/hbLite.R>
>> ");
>> hbLite("R.utils")
>>
>> Any feedback (positive or negative) is appreciated.
>>
>> Hope it helps
>>
>> /Henrik
>>
>>
>> Thank you.
>>>
>>> Bests,
>>> Renaud
>>>
>>> --
>>> Renaud Gaujoux
>>> Computational Biology - University of Cape Town
>>> South Africa
>>>
>>>
>>> ______________________________**________________
>> R-devel_at_r-project.org mailing list
>> https://stat.ethz.ch/mailman/**listinfo/r-devel<https://stat.ethz.ch/mailman/listinfo/r-devel>
>>
>>
>>
>
> --
> Spencer Graves, PE, PhD
> President and Chief Technology Officer
> Structure Inspection and Monitoring, Inc.
> 751 Emerson Ct.
> San Josť, CA 95126
> ph: 408-655-4567
> web: www.structuremonitoring.com
>
>
>

        [[alternative HTML version deleted]]



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue 18 Dec 2012 - 12:54:21 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 19 Dec 2012 - 05:32:53 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive