Re: [Rd] index.search

2014-06-16 Thread Adrian Dușa
On Mon, Jun 16, 2014 at 10:32 AM, Martin Maechler wrote: > [...] > > Apropos "not the right tool". I'm a bit astonished that nobody > mentioned the fact R already provides "the tool" to > automatically compare all example outputs with a previous > version (of the packages example outputs): As ap

Re: [Rd] index.search

2014-06-16 Thread Duncan Murdoch
On 16/06/2014 3:32 AM, Martin Maechler wrote: > Adrian Dușa > on Mon, 16 Jun 2014 08:33:59 +0300 writes: > On Mon, Jun 16, 2014 at 6:37 AM, Gabriel Becker > wrote: >> [...] You can. This is valid R source, so the parser >> will understand it >> >> exp

Re: [Rd] index.search

2014-06-16 Thread Brian Lee Yung Rowe
Thanks for the great insight. I love that there's always something else to learn in R. ••••• Brian Lee Yung Rowe Founder, Zato Novo Professor, M.S. Data Analytics, CUNY On Jun 16, 2014, at 3:34 AM, Martin Maechler wrote: >> Adrian Dușa >>on Mon, 16 Jun 2014 08:33:59 +0

Re: [Rd] index.search

2014-06-16 Thread Adrian Dușa
Oh my... this is so simple, why didn't I think of that...? Thanks a lot Martin, beautiful, Adrian On Mon, Jun 16, 2014 at 10:32 AM, Martin Maechler wrote: >> Adrian Duºa >> on Mon, 16 Jun 2014 08:33:59 +0300 writes: > > > On Mon, Jun 16, 2014 at 6:37 AM, Gabriel Becker > >

Re: [Rd] index.search

2014-06-16 Thread Martin Maechler
> Adrian Dușa > on Mon, 16 Jun 2014 08:33:59 +0300 writes: > On Mon, Jun 16, 2014 at 6:37 AM, Gabriel Becker > wrote: >> [...] You can. This is valid R source, so the parser >> will understand it >> >> expr = parse(text= example("deMorgan", package="QCA",

Re: [Rd] index.search

2014-06-15 Thread Adrian Dușa
On Mon, Jun 16, 2014 at 6:37 AM, Gabriel Becker wrote: > [...] > You can. This is valid R source, so the parser will understand it > > expr = parse(text= example("deMorgan", package="QCA", give.lines=TRUE)) > > You can then evaluate some or all of that expression using either R's own > eval packag

Re: [Rd] index.search

2014-06-15 Thread Adrian Dușa
On Mon, Jun 16, 2014 at 6:36 AM, Brian Lee Yung Rowe wrote: > Adrian, > > You might consider using a unit testing framework such as RUnit or testthat, > which does this but in a more structured manner. Essentially you codify the > behavior in a set of tests as opposed to comparing with a previous

Re: [Rd] index.search

2014-06-15 Thread Gabriel Becker
On Sun, Jun 15, 2014 at 8:23 PM, Adrian Dușa wrote: > Hi Gabriel, > > > I tried using the example() function, like this: > example("deMorgan", package="QCA", give.lines=TRUE) > > That returns the commands from the examples section, but if a command > is split over multiple rows I cannot use it

Re: [Rd] index.search

2014-06-15 Thread Brian Lee Yung Rowe
Adrian, You might consider using a unit testing framework such as RUnit or testthat, which does this but in a more structured manner. Essentially you codify the behavior in a set of tests as opposed to comparing with a previous version. HTH, Brian ••••• Brian Lee Yung Rowe Founder, Z

Re: [Rd] index.search

2014-06-15 Thread Adrian Dușa
Hi Gabriel, Actually, I am not going to use multiple versions of the same package, but always the last version. What I would like to do is: - to run all examples from all functions in the package, saving the results into a list - compare the list to an already saved one (from the previous version

Re: [Rd] index.search

2014-06-15 Thread Gabriel Becker
Adrian, R isn't really designed to use multiple versions of the same package in the same R session. To do what you want you'll need to unload one version of the package before you load the next, which will work some percentage of the time between 50 and 100 ("usually"), but when it can be done it

[Rd] index.search

2014-06-15 Thread Adrian Dușa
Dear r-devel, I am trying to automatically check if two successive versions of a package have the same results (i.e. code not broken), by parsing the example sections for each function against a previously tested version. While trying to replicate the code from example(), I am facing an error rel