Re: [Rd] proposal for adapting code of function gl()

2011-04-12 Thread Joris Meys
Thanks for the explanation, I wasn't fully aware of which optimization I was using. I reckon your solution is more R-sound, so no reason to keep with my bizarre workaround. It would be nice though if gl() got optimized. Thank you for the example too, I'm learning every day. Cheers Joris On Tue, A

Re: [Rd] Conditional "Suggests"

2011-04-12 Thread Friedrich Leisch
> On Mon, 11 Apr 2011 13:30:24 -0700, > Geoff Jentry (GJ) wrote: > On Mon, 11 Apr 2011, Hadley Wickham wrote: >>> To me this reads as being in the wheelhouse of what 'Suggests' is supposed >>> to imply, as per the R Extensions manual.  The problem here is that if PkgB >>> is put d

Re: [Rd] duplicates() function

2011-04-12 Thread Petr Savicky
On Mon, Apr 11, 2011 at 02:05:11PM -0400, Duncan Murdoch wrote: > On 08/04/2011 11:39 AM, Joshua Ulrich wrote: > >On Fri, Apr 8, 2011 at 10:15 AM, Duncan Murdoch > > wrote: > >> On 08/04/2011 11:08 AM, Joshua Ulrich wrote: > >>> > >>> How about: > >>> > >>> y<- rep(NA,length(x)) > >>> y[duplic

Re: [Rd] Conditional "Suggests"

2011-04-12 Thread Geoff Jentry
On Tue, 12 Apr 2011, Friedrich Leisch wrote: That is not the case, the checks will only get a NOTE that PkgB doesn't exist. E.g., my package flexclust suggests multicore, which is not available for windows. Still both live happily on CRAN, and of course there is a windows version of flexclust a

[Rd] Text differencing code in R?

2011-04-12 Thread Duncan Murdoch
I've been running the R daily news feeds (http://developer.r-project.org/RSSfeeds.html) using some Java code called from R to compute and display differences in the NEWS.Rd file from day to day. (The code was taken from http://code.google.com/p/google-diff-match-patch/). Using Java has meant

[Rd] all.equal(data.frame(package_version()), ...) infinite recursion

2011-04-12 Thread William Dunlap
With R-2.12.2 on Linux: > z <- data.frame(Version=package_version(c("0.1")), row.names=c("pkgA")) > all.equal(z, z) # expect TRUE Error: evaluation nested too deeply: infinite recursion / options(expressions=)? > traceback() ... lots of lines in a 3-cycle ... 6: all.equal.list(target,

Re: [Rd] proposal for adapting code of function gl()

2011-04-12 Thread peter dalgaard
On Apr 12, 2011, at 10:33 , Joris Meys wrote: > Thanks for the explanation, I wasn't fully aware of which optimization > I was using. I reckon your solution is more R-sound, so no reason to > keep with my bizarre workaround. It would be nice though if gl() got > optimized. Thank you for the examp

[Rd] parse_Rd raises error when example section contains a quoted percent character

2011-04-12 Thread Jeffrey Horner
I was writing Rd documentation for a new package when I came across this issue. Here's the smallest example: > library(tools) > cat("\\examples{x <- '<%=rnorm(1)%>'}\n",file=file.path(tempdir(),'test.Rd')) > readLines(file.path(tempdir(),'test.Rd')) [1] "\\examples{x <- '<%=rnorm(1)%>'}" > parse_R

Re: [Rd] parse_Rd raises error when example section contains a quoted percent character

2011-04-12 Thread Jeffrey Horner
Thanks for setting me straight, Kurt. Problem solved. Jeff On Tue, Apr 12, 2011 at 11:29 AM, Kurt Hornik wrote: >> Jeffrey Horner writes: > > % is the Rd comment character, and almost always needs to be escaped. > > Best > -k > >> I was writing Rd documentation for a new package when I came

Re: [Rd] parse_Rd raises error when example section contains a quoted percent character

2011-04-12 Thread peter dalgaard
On Apr 12, 2011, at 18:24 , Jeffrey Horner wrote: > I was writing Rd documentation for a new package when I came across > this issue. Here's the smallest example: > >> library(tools) >> cat("\\examples{x <- '<%=rnorm(1)%>'}\n",file=file.path(tempdir(),'test.Rd')) >> readLines(file.path(tempdir()

[Rd] Signal handling / alarm timeouts

2011-04-12 Thread Murray Stokely
What are the ramifications of setting up user signal handling to allow the use of e.g. alarm(2) to send a SIGALRM to the R process at some number of seconds in the future to e.g. interrupt a routine that is taking too long to complete. I can't find any R language support for this (e.g. a timeout a

Re: [Rd] Signal handling / alarm timeouts

2011-04-12 Thread Henrik Bengtsson
On Tue, Apr 12, 2011 at 3:58 PM, Murray Stokely wrote: > What are the ramifications of setting up user signal handling to allow > the use of e.g. alarm(2) to send a SIGALRM to the R process at some > number of seconds in the future to e.g. interrupt a routine that is > taking too long to complete.

Re: [Rd] R CMD build --resave-data

2011-04-12 Thread Hervé Pagès
Hi Uwe, On 11-04-11 08:13 AM, Uwe Ligges wrote: On 11.04.2011 02:47, Hervé Pagès wrote: Hi, More about the new --resave-data option As mentioned previously here https://stat.ethz.ch/pipermail/r-devel/2011-April/060511.html 'R CMD build' and 'R CMD INSTALL' handle this new option inconsist

Re: [Rd] R CMD build --resave-data

2011-04-12 Thread Simon Urbanek
On Apr 12, 2011, at 8:53 PM, Hervé Pagès wrote: > Hi Uwe, > > On 11-04-11 08:13 AM, Uwe Ligges wrote: >> >> >> On 11.04.2011 02:47, Hervé Pagès wrote: >>> Hi, >>> >>> More about the new --resave-data option >>> >>> As mentioned previously here >>> >>> https://stat.ethz.ch/pipermail/r-devel/

Re: [Rd] R CMD build --resave-data

2011-04-12 Thread Hadley Wickham
>> If you deliberately ignore the fact that 'R CMD INSTALL' is also used >> by developers to install from the *package source tree* (by opposition >> to end users who use it to install from a *source tarball*, > > .. for a good reason, IMHO no serious developer would do that for obvious > reasons

Re: [Rd] R CMD build --resave-data

2011-04-12 Thread Simon Urbanek
On Apr 12, 2011, at 10:26 PM, Hadley Wickham wrote: >>> If you deliberately ignore the fact that 'R CMD INSTALL' is also used >>> by developers to install from the *package source tree* (by opposition >>> to end users who use it to install from a *source tarball*, >> >> .. for a good reason, IMH

Re: [Rd] R CMD build --resave-data

2011-04-12 Thread Hervé Pagès
On 11-04-12 07:06 PM, Simon Urbanek wrote: On Apr 12, 2011, at 8:53 PM, Hervé Pagès wrote: Hi Uwe, On 11-04-11 08:13 AM, Uwe Ligges wrote: On 11.04.2011 02:47, Hervé Pagès wrote: Hi, More about the new --resave-data option As mentioned previously here https://stat.ethz.ch/pipermail/r-d