Re: [Rd] Using unit-tests as examples

2014-01-20 Thread Alexey Sergushichev
Yes, this may work, but this way I have to have one test per file, which is not very convenient. --- Alexey On Sat, Jan 18, 2014 at 7:43 PM, Hadley Wickham h.wick...@gmail.com wrote: If you're using roxygen2, you can use @example tag to include an external file into the examples. Hadley

Re: [Rd] [R-SIG-Mac] My first package

2014-01-20 Thread Matthew Denwood
On 20 Jan 2014, at 09:31, Federico Calboli f.calb...@imperial.ac.uk wrote: On 18 Jan 2014, at 14:31, Axel Urbiz axel.ur...@gmail.com wrote: Hi All, I'm planning to submit my first package to R, and although I read all the documentation, I'm not very clear on the following 2 items, from

Re: [Rd] [R-SIG-Mac] My first package

2014-01-20 Thread Federico Calboli
On 18 Jan 2014, at 14:31, Axel Urbiz axel.ur...@gmail.com wrote: Hi All, I'm planning to submit my first package to R, and although I read all the documentation, I'm not very clear on the following 2 items, from which I'd appreciate your guidance: 1)I understand it is suggested to

Re: [Rd] Using unit-tests as examples

2014-01-20 Thread Hadley Wickham
The problem with extracting a single test from a file is going to be locating the relevant lines of code and cleanly pulling them out (along with any needed supporting code). It might be better to attack the problem in the opposite direction by having a roxygen2 directive that inserted the block

Re: [Rd] How to debug an R package (with C code)

2014-01-20 Thread Gábor Csárdi
I don't know where you have gdb from, but it is not included in the latest xcode, afaik. If you install it by hand, or from brew, then you'll see what I saw. Maybe you have a gdb version from an older xcode lying around, or I don't know. See also

Re: [Rd] [R-SIG-Mac] My first package

2014-01-20 Thread Gábor Csárdi
On Mon, Jan 20, 2014 at 4:31 AM, Federico Calboli f.calb...@imperial.ac.ukwrote: [...] Is it? this is news to me. I have a grand total of 2 packages up and I never ever used R-devel, and never ever had a problem, had a report of a problem or had a note from CRAn about my packages not being

Re: [Rd] [R-SIG-Mac] My first package

2014-01-20 Thread Federico Calboli
On 20 Jan 2014, at 14:51, Gábor Csárdi csardi.ga...@gmail.com wrote: On Mon, Jan 20, 2014 at 4:31 AM, Federico Calboli f.calb...@imperial.ac.uk wrote: [...] Is it? this is news to me. I have a grand total of 2 packages up and I never ever used R-devel, and never ever had a problem, had

Re: [Rd] [R-SIG-Mac] My first package

2014-01-20 Thread Gábor Csárdi
On Mon, Jan 20, 2014 at 9:58 AM, Federico Calboli f.calb...@imperial.ac.ukwrote: [...] I do that *with the current release of R* and I never had an issue whatsoever. Incidentally the words 'This should be done with the current version of R-devel (or if that is not possible, current R-patched

[Rd] Fwd: [R-SIG-Mac] My first package

2014-01-20 Thread Gábor Csárdi
On Mon, Jan 20, 2014 at 10:34 AM, Federico Calboli f.calb...@imperial.ac.uk wrote: [...] That's as interesting as the English language makes it -- please note of the expression 'should' as opposed to 'must', and the list of three options of R versions. Well, my interpretation is that

Re: [Rd] formals() adds 0 to complex function arguments

2014-01-20 Thread peter dalgaard
On 20 Jan 2014, at 00:00 , Duncan Murdoch murdoch.dun...@gmail.com wrote: Someone might want to fix this by implementing a full syntax for complex constants, but meanwhile, I think a passable workaround could be That might be nice to do. Not sure if it's easy or hard... I think it's

Re: [Rd] [R-SIG-Mac] My first package

2014-01-20 Thread Simon Urbanek
On Jan 20, 2014, at 4:31 AM, Federico Calboli f.calb...@imperial.ac.uk wrote: On 18 Jan 2014, at 14:31, Axel Urbiz axel.ur...@gmail.com wrote: Hi All, I'm planning to submit my first package to R, and although I read all the documentation, I'm not very clear on the following 2 items,

Re: [Rd] formals() adds 0 to complex function arguments

2014-01-20 Thread Hadley Wickham
On Sun, Jan 19, 2014 at 3:16 PM, peter dalgaard pda...@gmail.com wrote: It's not formals() that is doing you in. Rather, it is a conspiration between two things: (a) R always displays complex constants as x+yi, even if x is zero and (b) there really is no way to specify complex constants

Re: [Rd] Using unit-tests as examples

2014-01-20 Thread Spencer Graves
You are probably wisest to follow Hadley's recommendation. [library(fortunes); fortune(298)] However, my help files contain various constructs of the following form: \dontshow{stopifnot(} all.equal(fa, fa0) \dontshow{)} where fa is returned by a function, and fa0 is a