[Rd] multiple issues with is.unsorted()

2013-04-24 Thread Hervé Pagès
Hi, In the man page for is.unsorted(): Value: A length-one logical value. All objects of length 0 or 1 are sorted: the result will be ‘NA’ for objects of length 2 or more except for atomic vectors and objects with a class (where the ‘=’ or ‘’ method is used to compare

Re: [Rd] is.vector(as.vector(x, m), m) not always TRUE

2013-04-24 Thread peter dalgaard
On Apr 24, 2013, at 01:48 , Hervé Pagès wrote: In the man page for as.vector() (same as man page for vector()): Writers of methods for ‘as.vector’ need to take care to follow the conventions of the default method. In particular • Argument ‘mode’ can be ‘any’, any of the

Re: [Rd] about the 'length' arg of vector()

2013-04-24 Thread Martin Maechler
Hervé Pagès hpa...@fhcrc.org on Tue, 23 Apr 2013 16:20:00 -0700 writes: Hi, In the man page for vector(): length: A non-negative integer specifying the desired length. Double values will be coerced to integer: supplying an argument of length other than one is an

Re: [Rd] multiple issues with is.unsorted()

2013-04-24 Thread Martin Maechler
Dear Herve, Hervé Pagès hpa...@fhcrc.org on Tue, 23 Apr 2013 23:09:21 -0700 writes: Hi, In the man page for is.unsorted(): Value: A length-one logical value. All objects of length 0 or 1 are sorted: the result will be ‘NA’ for objects of length 2 or

Re: [Rd] as.name and namespaces

2013-04-24 Thread Patrick Burns
Here is an example problem: mycall - expression(lm(Y ~ x))[[1]] mycall lm(Y ~ x) newname - stats::lm desiredResult stats::lm(Y ~ x) I've solved the problem in the kludgy way of deparsing, fixing the string and then parsing. I like Duncan's third method, but it seems like it assumes the

Re: [Rd] as.name and namespaces

2013-04-24 Thread peter dalgaard
There's also the brute force option: mycall - expression(lm(Y ~ x))[[1]] mycall[[1]] - quote(stats::lm) mycall stats::lm(Y ~ x) eval(mycall, list(Y=rnorm(5),x=1:5)) Call: stats::lm(formula = Y ~ x) Coefficients: (Intercept)x 0.07430 0.02981 On Apr 24, 2013, at

Re: [Rd] Solved and Question: Problem with S3 method dispatch and NAMESPACE

2013-04-24 Thread peter dalgaard
On Apr 24, 2013, at 15:59 , Frank Harrell wrote: I found that package quantreg has created a new generic for latex() [I wish it hadn't; this has been a generic in Hmisc for almost 2 decades]. When I require(quantreg) after loading rms, latex(anova.rms object) dispatches latex.default, but

Re: [Rd] Solved and Question: Problem with S3 method dispatch and NAMESPACE

2013-04-24 Thread Frank Harrell
Thank you very much Peter. That did the trick. Frank Peter Dalgaard-2 wrote On Apr 24, 2013, at 15:59 , Frank Harrell wrote: I found that package quantreg has created a new generic for latex() [I wish it hadn't; this has been a generic in Hmisc for almost 2 decades]. When I

Re: [Rd] multiple issues with is.unsorted()

2013-04-24 Thread Martin Maechler
More comments .. see inline Martin Maechler maech...@stat.math.ethz.ch on Wed, 24 Apr 2013 11:29:39 +0200 writes: Dear Herve, Hervé Pagès hpa...@fhcrc.org on Tue, 23 Apr 2013 23:09:21 -0700 writes: Hi, In the man page for is.unsorted(): Value: A length-one logical

Re: [Rd] about the 'length' arg of vector()

2013-04-24 Thread Hervé Pagès
On 04/24/2013 12:53 AM, Martin Maechler wrote: Hervé Pagès hpa...@fhcrc.org on Tue, 23 Apr 2013 16:20:00 -0700 writes: Hi, In the man page for vector(): length: A non-negative integer specifying the desired length. Double values will be coerced to integer:

Re: [Rd] multiple issues with is.unsorted()

2013-04-24 Thread Hervé Pagès
Hi Martin, On 04/24/2013 02:29 AM, Martin Maechler wrote: Dear Herve, Hervé Pagès hpa...@fhcrc.org on Tue, 23 Apr 2013 23:09:21 -0700 writes: Hi, In the man page for is.unsorted(): Value: A length-one logical value. All objects of length 0 or 1 are

Re: [Rd] is.vector(as.vector(x, m), m) not always TRUE

2013-04-24 Thread peter dalgaard
This is now fixed in R-devel (never actually bit anyone, did it?) -pd On Apr 24, 2013, at 08:11 , peter dalgaard wrote: is.vector(as.vector(a, name), name) [1] FALSE Mmmh, the default method itself doesn't seem to follow its own conventions :-/ Looks like there should be a

Re: [Rd] as.name and namespaces

2013-04-24 Thread William Dunlap
Hi Pat, You could use substitute(), mycall - quote(list(lm(Y ~ x1), lm(Y ~ x2))) do.call(substitute, list(mycall, list(lm=quote(stats::lm list(stats::lm(Y ~ x1), stats::lm(Y ~ x2)) The do.call is necessary because substitute() does not evaluate its first argument and we want 'mycall'

Re: [Rd] multiple issues with is.unsorted()

2013-04-24 Thread William Dunlap
is.unsorted(NA) [1] NA = Contradicts all objects of length 0 or 1 are sorted. Ok. I really think we should change the above. If NA is for a missing number, it still cannot be unsorted if it is of length one. -- the above will give FALSE real soon now. It depends what you

Re: [Rd] Verbose output from R CMD check

2013-04-24 Thread dpleydell
Many thanks for these comments Simon, that really helps me a lot! warm regards David On 23/04/13 19:30, Simon Urbanek wrote: On Apr 23, 2013, at 12:43 PM, dpleydell wrote: Many thanks Simon for your response Identifying the source of the message is a non-trivial problem because there

Re: [Rd] multiple issues with is.unsorted()

2013-04-24 Thread Hervé Pagès
Hi, On 04/24/2013 09:27 AM, William Dunlap wrote: is.unsorted(NA) [1] NA = Contradicts all objects of length 0 or 1 are sorted. Ok. I really think we should change the above. If NA is for a missing number, it still cannot be unsorted if it is of length one. -- the above will

Re: [Rd] multiple issues with is.unsorted()

2013-04-24 Thread Hervé Pagès
On 04/24/2013 12:00 PM, Hervé Pagès wrote: Hi, On 04/24/2013 09:27 AM, William Dunlap wrote: is.unsorted(NA) [1] NA = Contradicts all objects of length 0 or 1 are sorted. Ok. I really think we should change the above. If NA is for a missing number, it still cannot be

Re: [Rd] is.vector(as.vector(x, m), m) not always TRUE

2013-04-24 Thread Hervé Pagès
On 04/24/2013 09:02 AM, peter dalgaard wrote: This is now fixed in R-devel (never actually bit anyone, did it?) Thanks for fixing... before someone gets bitten :-) as.vector() just made it into the BiocGenerics package, and the man page for BiocGenerics::as.vector redirects the reader to the

Re: [Rd] Patch proposal for R style consistency (concerning deparse.c)

2013-04-24 Thread Duncan Murdoch
On 13-04-24 8:08 PM, Hervé Pagès wrote: On 04/18/2013 11:41 AM, Yihui Xie wrote: I second the change of } else {. Me too. Note that print.function() will screw it only if you use useSource=FALSE: print.function(foo3, useSource=FALSE) function () { if (FALSE) {

[Rd] Error Message while creation Package

2013-04-24 Thread Crish..
Hello Guys, I wanted to build a new R package from the R code. I installed all the required software and made all the path settings. When i tried running, cmd RCMD check SamplePackageName while Checking R code for possible errors i have encountered a note saying: waning in

[Rd] Error Message while Package creation

2013-04-24 Thread Crish..
Hello Guys, I wanted to build a new R package from the R code. I installed all the required software and made all the path settings. When i tried running, cmd RCMD check SamplePackageName while Checking R code for possible errors i have encountered a note saying: waning in

Re: [Rd] Error Message while Package creation

2013-04-24 Thread Berend Hasselman
On 25-04-2013, at 07:21, Crish.. krishnaiah...@gmail.com wrote: Hello Guys, I wanted to build a new R package from the R code. I installed all the required software and made all the path settings. When i tried running, cmd RCMD check SamplePackageName while Checking R code for