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 wrote: > If you're using roxygen2, you can use @example tag to include an > external file into the examples. > > Hadley > > On Sat, Jan 18,

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

2014-01-20 Thread Matthew Denwood
On 20 Jan 2014, at 09:31, Federico Calboli wrote: > On 18 Jan 2014, at 14:31, Axel Urbiz 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 guid

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

2014-01-20 Thread Federico Calboli
On 18 Jan 2014, at 14:31, Axel Urbiz 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 use the R dev

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 in

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 http://stackoverflow.com/questions/19554439/gdb-mis

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 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 a report of a > problem or had a note from CRAn about my packages not being ok because I > built th

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 wrote: > On Mon, Jan 20, 2014 at 4:31 AM, Federico Calboli > 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 a report of a > problem or had a note fro

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 wrote: [...] > 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 or the > current relea

[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 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 package maintainers are ex

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

2014-01-20 Thread peter dalgaard
On 20 Jan 2014, at 00:00 , Duncan Murdoch 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 hard. Afte

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

2014-01-20 Thread Simon Urbanek
On Jan 20, 2014, at 4:31 AM, Federico Calboli wrote: > On 18 Jan 2014, at 14:31, Axel Urbiz 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

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 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 with non-zero r

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" i