Re: [Rd] Proposal unary - operator for factors

2010-02-03 Thread Hadley Wickham
>>> Could you remind me what xtfrm stands for? >> >> No, I don't think I ever worked it out. :-) > > The same logic as strxfrm. strxfrm is short for string transform. => stxfrm is short for string tansform => txfrm is short for tansform => xtfrm is short of snatform? Hadley -- http://had.co.nz/

Re: [Rd] Proposal unary - operator for factors

2010-02-03 Thread Prof Brian Ripley
On Wed, 3 Feb 2010, Duncan Murdoch wrote: On 03/02/2010 7:20 PM, Hadley Wickham wrote: Currently, for numeric a you can do either order(-a) or order(a, decreasing=FALSE) For nonnumeric types like POSIXct and factors only the latter works. Under my proposal your order(a, -b, c, d) would b

[Rd] proposal for new axis.Date/axis.POSIXct

2010-02-03 Thread Felix Andrews
[reposting after holiday period] -- Forwarded message -- From: Felix Andrews Date: 21 December 2009 23:44 Subject: proposal for new axis.Date/axis.POSIXct To: r-devel@r-project.org Hi R-devel. I've noticed a couple of quirks in the current time/date axis functions (axis.Date, a

Re: [Rd] Proposal unary - operator for factors

2010-02-03 Thread Duncan Murdoch
On 03/02/2010 7:20 PM, Hadley Wickham wrote: Currently, for numeric a you can do either order(-a) or order(a, decreasing=FALSE) For nonnumeric types like POSIXct and factors only the latter works. Under my proposal your order(a, -b, c, d) would be order(a, b, c, d, decreasing=c(FALSE,TRU

Re: [Rd] Proposal unary - operator for factors

2010-02-03 Thread William Dunlap
> -Original Message- > From: Duncan Murdoch [mailto:murd...@stats.uwo.ca] > Sent: Wednesday, February 03, 2010 4:17 PM > To: William Dunlap > Cc: Hadley Wickham; r-devel@r-project.org > Subject: Re: [Rd] Proposal unary - operator for factors > > On 03/02/2010 6:49 PM, William Dunlap wrot

Re: [Rd] Proposal unary - operator for factors

2010-02-03 Thread Hadley Wickham
>> Currently, for numeric a you can do either >>   order(-a) >> or >>   order(a, decreasing=FALSE) >> For nonnumeric types like POSIXct and factors only >> the latter works. >> >> Under my proposal your >>   order(a, -b, c, d) >> would be >>   order(a, b, c, d, decreasing=c(FALSE,TRUE,FALSE,TRUE))

Re: [Rd] Proposal unary - operator for factors

2010-02-03 Thread Duncan Murdoch
On 03/02/2010 6:49 PM, William Dunlap wrote: -Original Message- From: h.wick...@gmail.com [mailto:h.wick...@gmail.com] On Behalf Of Hadley Wickham Sent: Wednesday, February 03, 2010 3:38 PM To: William Dunlap Cc: r-devel@r-project.org Subject: Re: [Rd] Proposal unary - operator for fact

Re: [Rd] Proposal unary - operator for factors

2010-02-03 Thread William Dunlap
> -Original Message- > From: h.wick...@gmail.com [mailto:h.wick...@gmail.com] On > Behalf Of Hadley Wickham > Sent: Wednesday, February 03, 2010 3:38 PM > To: William Dunlap > Cc: r-devel@r-project.org > Subject: Re: [Rd] Proposal unary - operator for factors > > > It wouldn't make sense

Re: [Rd] Proposal unary - operator for factors

2010-02-03 Thread Hadley Wickham
> It wouldn't make sense in the context of >   vector[-factor] True, but that doesn't work currently so you wouldn't lose anything. However, it would make a certain class of problem that used to throw errors become silent. > Wouldn't it be better to allow order's decreasing argument > to be a vec

Re: [Rd] Proposal unary - operator for factors

2010-02-03 Thread William Dunlap
> -Original Message- > From: r-devel-boun...@r-project.org > [mailto:r-devel-boun...@r-project.org] On Behalf Of Hadley Wickham > Sent: Wednesday, February 03, 2010 3:10 PM > To: r-devel@r-project.org > Subject: [Rd] Proposal unary - operator for factors > > Hi all, > > Why not make the

[Rd] Proposal unary - operator for factors

2010-02-03 Thread Hadley Wickham
Hi all, Why not make the unary minus operator return the factor with levels reversed? This would make it much easier to sort factors in descending order in part of an order statement. Hadley -- http://had.co.nz/ __ R-devel@r-project.org mailing list

[Rd] Fwd: ctrl-C aborts R when compiling package code with ICC+openMP

2010-02-03 Thread Ernest Turro
I omitted to mention that when I set KMP_DUPLICATE_LIB_OK=TRUE and OMP_NUM_THREADS=1, I consistently get this error instead: OMP: Error #13: Assertion failure at kmp_csupport.c(465). OMP: Hint: Please submit a bug report with this message, compile and run commands used, and machine configuration

[Rd] ctrl-C aborts R when compiling package code with ICC+openMP

2010-02-03 Thread Ernest Turro
Hi all, I have some C++ code that I call from my package. In my main C++ loop, I check for user interrupts and return to the R shell after ensuring I've deallocated memory appropriately. This works fine when the code is compiled with gcc+openmp and with icc without openmp, but when I compile wi

[Rd] mclapply on a set not divisible by number of cores (PR#14205)

2010-02-03 Thread o . heil
Full_Name: Oliver Heil Version: 2.10.0 OS: debian squeeze Submission from: (NULL) (193.174.58.251) When running mclapply on a list of strings with a length of 618 on 10 cores the resulting data is wrong every 10 entries starting with the 6th. Our machine has 16 cores. You may reproduce the error

Re: [Rd] Error with cut.POSIXt and daylight savings time switchover dates

2010-02-03 Thread Brian Diggs
On 2/1/2010 3:57 PM, Brian Diggs wrote: > The following code: > > cut(as.POSIXct("2009-11-01 04:00:00", tz="America/Los_Angeles"), "1 day") > > gives the error: > > Error in seq.int(0, to - from, by) : 'to' must be finite > > This is related to November 1st, 2009 being the switchover date from

Re: [Rd] Package options

2010-02-03 Thread Prof Brian Ripley
A number of packages do this. See e.g. 'sm' and its function sm.options() for one implementation. On Wed, 3 Feb 2010, Duncan Murdoch wrote: On 03/02/2010 8:07 AM, Chris Brien wrote: Dear all, I am developing a package foo that has a namespace. I would like to be able to provide an option,

Re: [Rd] Package options

2010-02-03 Thread Duncan Murdoch
On 03/02/2010 8:07 AM, Chris Brien wrote: Dear all, I am developing a package foo that has a namespace. I would like to be able to provide an option, say opt, that 1) is set to a default value when the package is loaded 2) can be set to a different value by the package user 3) is used by func

[Rd] Package options

2010-02-03 Thread Chris Brien
Dear all, I am developing a package foo that has a namespace. I would like to be able to provide an option, say opt, that 1) is set to a default value when the package is loaded 2) can be set to a different value by the package user 3) is used by functions within the package How can I achieve

[Rd] Package Directory Hierarchy: Recursive inclusion of *.R possible?

2010-02-03 Thread Johannes Graumann
Hello, I would like to organize the "R" directory in my home-grown package into sub-directories, but "R CMD --build" doesn't seem to find *.R files below the actual source directory. Is there any way around that? Thanks, Joh __ R-devel@r-project.org

Re: [Rd] choose(n,k) when n is almost integer

2010-02-03 Thread Petr Savicky
On Tue, Feb 02, 2010 at 01:37:46PM +0100, Petr Savicky wrote: > I would like to add some more information concerning the patch C > to the function choose() proposed in the email > https://stat.ethz.ch/pipermail/r-devel/2009-December/056177.html > > The patch uses transformations of choose(n, k),